aashcool198 Posted December 2, 2009 Share Posted December 2, 2009 hi.. i have written a PHP code in which i reload the page when user selects a value in dropdown... function reload(form) { var val=form.cat.options[form.cat.options.selectedIndex].value; self.location='form.php?cat=' + val; } the problem with this script is that it can retain only the numbers which is the value of the selected item in the drop-down.I also want to retain the name field which is an input string. How can i do it? Link to comment https://forums.phpfreaks.com/topic/183758-save-user-inputs-while-javascript-reloading/ Share on other sites More sharing options...
rajivgonsalves Posted December 2, 2009 Share Posted December 2, 2009 function reload(form) { var val=form.cat.options[form.cat.options.selectedIndex].value; var name=form.cat.options[form.cat.options.selectedIndex].text; self.location='form.php?cat=' + val + '&name='+ name; } Link to comment https://forums.phpfreaks.com/topic/183758-save-user-inputs-while-javascript-reloading/#findComment-969920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.