ghurty Posted August 7, 2007 Share Posted August 7, 2007 Hi I am pretty new to php coding so please bear with me. I have a drop down list of locations, and then I have a calculate button to refresh the page using the new location. How can I have it that as soon as you click on a location, it recalculates, and that you dont need to click on the calculate button at all? Thanks <form name="mainform" action="index.php" method="get"> <input type="hidden" name="option" value="com_luach" /> <select name="activelocation"> <?php fillLocationList($activelocation); ?> </select> <input name="Submit" type="submit" value="Calculate"> Link to comment https://forums.phpfreaks.com/topic/63777-solved-when-selecting-from-dropdown-list-automatically-recalculates-how/ Share on other sites More sharing options...
dbo Posted August 7, 2007 Share Posted August 7, 2007 do an ajax call onchange but this is achieved with javascript not so much php Link to comment https://forums.phpfreaks.com/topic/63777-solved-when-selecting-from-dropdown-list-automatically-recalculates-how/#findComment-317825 Share on other sites More sharing options...
ghurty Posted August 7, 2007 Author Share Posted August 7, 2007 do an ajax call onchange but this is achieved with javascript not so much php Can you please be a little bit more descriptive or give me an example. Like I said I am quite new at this. Thanks Link to comment https://forums.phpfreaks.com/topic/63777-solved-when-selecting-from-dropdown-list-automatically-recalculates-how/#findComment-317828 Share on other sites More sharing options...
dbo Posted August 7, 2007 Share Posted August 7, 2007 Ajax is an advanced topic. It's also not really a topic for this forum. Check out the javascript forum on this site... they should be able to help. Link to comment https://forums.phpfreaks.com/topic/63777-solved-when-selecting-from-dropdown-list-automatically-recalculates-how/#findComment-317831 Share on other sites More sharing options...
rlindauer Posted August 7, 2007 Share Posted August 7, 2007 You just want to submit the form when someone selects an option in the dropdown menu yeah? <select name="activelocation" onchange="this.submit();"> Why bring ajax into this at all? Link to comment https://forums.phpfreaks.com/topic/63777-solved-when-selecting-from-dropdown-list-automatically-recalculates-how/#findComment-317833 Share on other sites More sharing options...
dbo Posted August 7, 2007 Share Posted August 7, 2007 Maybe I misunderstood what was being asked. I thought he wanted to know how when you selected say a country all the states that belong to it become listed in another drop down. Link to comment https://forums.phpfreaks.com/topic/63777-solved-when-selecting-from-dropdown-list-automatically-recalculates-how/#findComment-317837 Share on other sites More sharing options...
ghurty Posted August 8, 2007 Author Share Posted August 8, 2007 Thank you, That did the trick You just want to submit the form when someone selects an option in the dropdown menu yeah? <select name="activelocation" onchange="this.submit();"> Why bring ajax into this at all? Link to comment https://forums.phpfreaks.com/topic/63777-solved-when-selecting-from-dropdown-list-automatically-recalculates-how/#findComment-318008 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.