son.of.the.morning Posted December 11, 2011 Share Posted December 11, 2011 Can this me done guys? Quote Link to comment https://forums.phpfreaks.com/topic/252938-calling-a-javascript-function-with-a-select-option/ Share on other sites More sharing options...
joe92 Posted December 11, 2011 Share Posted December 11, 2011 Yes. Quote Link to comment https://forums.phpfreaks.com/topic/252938-calling-a-javascript-function-with-a-select-option/#findComment-1296907 Share on other sites More sharing options...
son.of.the.morning Posted December 11, 2011 Author Share Posted December 11, 2011 May i ask how?lol Quote Link to comment https://forums.phpfreaks.com/topic/252938-calling-a-javascript-function-with-a-select-option/#findComment-1296919 Share on other sites More sharing options...
joe92 Posted December 11, 2011 Share Posted December 11, 2011 The usual event gang, onclick etc. The best to use is onchange though as it will not do anything if you select the same option. <select onchange=""> Unless your asking about executing the js from within the option tag itself (your question is a bit ambiguous). Then I believe no events are supported by the option tag. However, if you are trying to find the value of the option that the user has selected, you just have to ask what the value of the select tag is. It will equal the selected option tag. Quote Link to comment https://forums.phpfreaks.com/topic/252938-calling-a-javascript-function-with-a-select-option/#findComment-1296926 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.