Jump to content

Spector

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Spector's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oh, I am sorry about that, I didn't notice the JS section . Nevermind, you kind of set me on the right path with the onchange="alert(this.value.selected);" (I was trying some really complicated things... don't know why) Than it was really easy to figure it out and it's working flawelessly now. Thanks
  2. Hello everyone. I am stuck with creating "price change". I have PHP array with sizes+prices with strings like: "XXL+350Kc". The part before "+" is shown as an option in select and the part between "+" and "K" is the value that I want to add to an initial price when an option is selected (without the page reload). I know this is time to use JS. But JS and me still are not the best friends So I would like to ask you for help. This is light version of my code: <div class=\"productProp\"><b>Price:</b></div><div class=\"productProp\">".$item['price']." Kc</div>"; if ($item['size'] <> "") { $size = explode(";", $item['size_value']); // getting the array of sizes+prices echo "<div class=\"productProp\">SIZE:</div> <div class=\"productProp\"><select name=\"size\">"; for ($i=0; $i<count($size); $i++) { $parsed_price[$i] = get_string_between($size1[$i], "+", "K"); //part with price - function is working so I am not including it to save space $parsed_size[$i] = substr($size[$i],0,strrpos($size[$i],'+')); //part with size echo "<option value=\"".$parsed_size[$i]."\" >".$parsed_size[$i]."</option>"; } echo "</select></div>"; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.