Select box onClick

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Select box onClick

Post by s.dot »

Err, I've done this before, so I know it's not that hard.

I have a select box, when a value is clicked from the drop-down box I'd like it to submit the form.

I tried:

Code: Select all

<option value=&quote;value&quote; onClick=&quote;this.form.submit();&quote;>Value</option>
It's a no go.
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

Post by harrisonad »

Code: Select all

<form name=frm action='somwhere.php'>
<select onchange=&quote;frm.submit()&quote;>
// ... bunch of options
</select>
</form>
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Sweet, thanks.
Post Reply