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. Link to comment https://forums.phpfreaks.com/topic/267943-select-box-with-input-box/ Share on other sites More sharing options...
Guest Posted September 3, 2012 Share Posted September 3, 2012 Javascript 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. 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; } 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
Archived
This topic is now archived and is closed to further replies.