Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.lang.javascript > #89

Re: Easy Javascript function too much for me

Newsgroups alt.comp.lang.javascript
Date 2022-12-17 01:20 -0800
References <MPG.21d1ce2269dffe629897e9@news.giganews.com>
Message-ID <db86a2fc-b939-45e5-9433-b16e70c55ab5n@googlegroups.com> (permalink)
Subject Re: Easy Javascript function too much for me
From V <vvvvvvwwwwwwwwwwwwwwwww@gmail.com>

Show all headers | View raw


The answering may be a bit late.
For the help of others too, who may be messing with this, I reply to this still.
The solution would have been a script.

var a = document.getElementById("Aa");
var value = a.value;
var value2=a.options[e.selectedIndex].text;
document.getElementById("Hiddenfield").value="Aaaaaaa"; (Based on the select value)
 




On Tuesday, December 18, 2007 at 10:32:03 PM UTC+2, Pupkin wrote:
> 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.

Back to alt.comp.lang.javascript | Previous | Next | Find similar


Thread

Re: Easy Javascript function too much for me V <vvvvvvwwwwwwwwwwwwwwwww@gmail.com> - 2022-12-17 01:20 -0800

csiph-web