shortysbest Posted September 23, 2010 Share Posted September 23, 2010 how would i get a option menu to load a new page into the div below when you click on the options. I know how to do this with just links and everything but im not quite sure about a menu like this, its also automatically generated depending on the classes available. Quote Link to comment https://forums.phpfreaks.com/topic/214209-javascript-get-external-page-using-an-option-menu/ Share on other sites More sharing options...
Omirion Posted September 23, 2010 Share Posted September 23, 2010 what? Quote Link to comment https://forums.phpfreaks.com/topic/214209-javascript-get-external-page-using-an-option-menu/#findComment-1114810 Share on other sites More sharing options...
shortysbest Posted September 23, 2010 Author Share Posted September 23, 2010 I want to load an external php with a dropdown menu (different options for different results). this is the kind of dropdown menu: <select name=""> <option value="#home" selected>English 12 CCP</option> <option value="2">English 12 MOD</option> <option value="3">English 12 HAP</option> <option value="4">Poetry E</option> </select> Basically this would be an attendance function, so when u click English 12 CCP it loads the students in that course, and the same for the other classes, each one would load different students, and it would only update the div that holds the students names so it doesn't reload the entire page. I know how to do this with regular links <a href=""></a> but not sure about doing it with each option Quote Link to comment https://forums.phpfreaks.com/topic/214209-javascript-get-external-page-using-an-option-menu/#findComment-1114812 Share on other sites More sharing options...
BlueSkyIS Posted September 24, 2010 Share Posted September 24, 2010 to your select element, add an onchange() or onselect() Javascript handler that calls an ajax javascript, which calls your php code on the server. the ajax receives the response and updates the content of the div accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/214209-javascript-get-external-page-using-an-option-menu/#findComment-1115020 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.