Jump to content

Help with DropDown Box


Aijaz

Recommended Posts

Hello,

 

Please verify this page, http://drtea.com/product/dr-tea/.

 

There is no drop down box for Quantity when United Kingdom as a country is selected. 

 

Please tell me how to where to rectify the code for this error?

 

Is it a PHP error or Javascript error?

 

Any help would be much appreciated. 

 

Regards,

 

Aijaz 

Link to comment
https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/
Share on other sites

Looks like a text field problem:

 

It will look something like this as it is:

<input type="text" name="dropme" value="myvalue">

Needs to look something like this:

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

Reference: http://www.w3schools.com/tags/tag_select.asp

if you want to pull a value out of the drop down using PHP then you need this:

<select name="automaker">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>

This would give the web page graceful degradation in my opinion with people disabling JavaScript.

 

Your Country dropdown has this onchange event

onchange="javascript:getDivContent('/ch_div_content.php?method=getPriceSets&countryId='+this.value,'divPriceSet','');return true;" 

On selecting a country from the menu it will pass in the selected options value to ch_div_content.php.

 

This script appears to be controlling the quantity field. For example selecting any country between Israel and United Kingdom from the country menu and a static quantity field is returned. However selecting any other country a dropdown box is returned.

Show us the form code + Javascript for the onchange function and where you are compiling the drop box and what ever is needed from ch_div_content.php that handles method=getPriceSets&countryId='+this.value.

 

Don't show any passwords / usernames or any secure data.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.