/    Sign up×
Community /Pin to ProfileBookmark

How to activate the onchange method of a select box?

Hello,
I have a form with one select box. I’d like to make the onchange method works. The form looks like this:

<form name=”form2″ action=”wtm.pl?tab=edit” method=”get” enctype=”multipart/form-data”>
<table border=”0″ cellpadding=”2″ cellspacing=”0″ class=”pagestyle” align=”left” width=”100%” style=”border:1px solid #999999;”>
<input name=”choice” type=”hidden” id=”choice” value=”finish”>
<tr>
<td align=”left” colspan=”2″ nowrap>
<select name=”proj” style=”width:160px” id=”status” onChange=”this.form2.submit(this.form2.choice.value=’proj’);”>
<option value=””>- Select Project -</option>
<!– TEMPLATE_BEGIN: prjactivity.tpl –>
<option value=”$$value” $$selected>$$name</option>
<!– TEMPLATE_END: prjactivity.tpl –>
</select>
</td>
</tr>
</table>
</form>

My problem is that when I choose an option from the select box I don’t get a variable “choice” in the URL. My onchange method does not work at all.

Please, if you find my mistake, help me.

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@jalarieJul 30.2007 — Perhaps:

onChange="this.form.choice.value=this.options[this.selectedIndex].value;this.form.submit();"
×

Success!

Help @trasy_bg spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...