narjis Posted September 3, 2012 Share Posted September 3, 2012 I'm trying to open a select box on clicking the input box. Can any body tell how is it possible. Quote Link to comment https://forums.phpfreaks.com/topic/267943-select-box-with-input-box/ Share on other sites More sharing options...
Spring Posted September 3, 2012 Share Posted September 3, 2012 Javascript Quote Link to comment https://forums.phpfreaks.com/topic/267943-select-box-with-input-box/#findComment-1374863 Share on other sites More sharing options...
Christian F. Posted September 3, 2012 Share Posted September 3, 2012 Yes, it's possible. Though, I'd use a proper select input element. If you're looking for auto-complete, then that's a whole different ballpark. Only recommendable when you have lots of options, and/or when they're generated by user-inputted data. Hint: I strongly recommend that you read this article. Quote Link to comment https://forums.phpfreaks.com/topic/267943-select-box-with-input-box/#findComment-1374864 Share on other sites More sharing options...
worrall Posted September 10, 2012 Share Posted September 10, 2012 Use the following in your code.. <select name="name" id="name" onchange="return checker(this.form);"> And keep the following code in your js folder.. function checker(frm) { var select_index = document.getElementById('name').selectedIndex; var option_value = document.getElementById('name').options[select_index].value; window.location = "search.php?id=" + option_value; } Quote Link to comment https://forums.phpfreaks.com/topic/267943-select-box-with-input-box/#findComment-1376653 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.