HighDots Forums  

Easy Javascript function too much for me

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Easy Javascript function too much for me in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pupkin
 
Posts: n/a

Default Easy Javascript function too much for me - 12-18-2007 , 02:32 PM






Hi,

This is easy for you, but I am dum. Can someone help me out?

I have a form that has a select field and a hidden field. I need the
hidden field to update based on the value of the select.

Like:

<form name="mydumform" onsubmit="makethiswork">
<select name="mydumselect">
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
<option>E</option>
<option>F</option>
<option>G</option>
</select>

<input type="hidden" name="dumfield">
<input type="submit" etc.>
</form>

if select = A B C or D, hidden = 1
if select = E F or G, hidden = 2
else hidden = 0


I know how these if then statments work, but what I suck at is
understanding how to phrase it as a function and then stick that
function into the form.

Whoever helps me with this may well change the way I understand the
universe.

Thanks.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.