Jump to content

select box with input box


narjis

Recommended Posts

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.

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;

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.