andibakker Posted May 15, 2009 Share Posted May 15, 2009 I one dropdownlist which causes a reload of the page, passing the value selected in a querystring so that the 2nd dropdownlist populates. This works well, but I am having trouble preserving form data when the javascript calls a reload of the page. Is there a way to have 1 dropdownlist that populates a 2nd dropdownlist without using javascript ? If so could you please show me a tutorial. I have seen loads of tutorials, but they all use javascript. Thanks Link to comment https://forums.phpfreaks.com/topic/158279-dropdown-list-based-on-1st-dropdownlist-selection-without-javascript/ Share on other sites More sharing options...
ohdang888 Posted May 15, 2009 Share Posted May 15, 2009 Well you have to use javascript to put the value of the input into the url its reloading... like.. window.location = 'your_page.php?field=' + value_of_field; then you can use php to grab that value and use it to have the automatically automatically set the value Link to comment https://forums.phpfreaks.com/topic/158279-dropdown-list-based-on-1st-dropdownlist-selection-without-javascript/#findComment-834818 Share on other sites More sharing options...
andibakker Posted May 15, 2009 Author Share Posted May 15, 2009 ok, so javascript is the only way. Now, how do I retain the user entered data from the form. I can do it using querystrings when the javascript reloads, but there is a limit to the amount of data I pass using a query string. Is there another way to retain this data ? Link to comment https://forums.phpfreaks.com/topic/158279-dropdown-list-based-on-1st-dropdownlist-selection-without-javascript/#findComment-834855 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.