Aijaz Posted March 19, 2014 Share Posted March 19, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/ Share on other sites More sharing options...
Ansego Posted March 19, 2014 Share Posted March 19, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/#findComment-1473083 Share on other sites More sharing options...
Strider64 Posted March 19, 2014 Share Posted March 19, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/#findComment-1473084 Share on other sites More sharing options...
Ansego Posted March 19, 2014 Share Posted March 19, 2014 @ Aijaz might want to show us your code, allows us to see a clear picture of what's going on under the hood. Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/#findComment-1473087 Share on other sites More sharing options...
Ch0cu3r Posted March 19, 2014 Share Posted March 19, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/#findComment-1473088 Share on other sites More sharing options...
Ansego Posted March 19, 2014 Share Posted March 19, 2014 I am about to log off, quick glance that looks ok, show more code... ch_div_content.php Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/#findComment-1473093 Share on other sites More sharing options...
Aijaz Posted March 19, 2014 Author Share Posted March 19, 2014 @Anesgo, which files do you need? Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/#findComment-1473121 Share on other sites More sharing options...
Ansego Posted March 19, 2014 Share Posted March 19, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/287081-help-with-dropdown-box/#findComment-1473126 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.