/t5/dreamweaver-discussions/using-onchange-or-onblur-to-changes-the-value-of-a-hidden-field/td-p/796340May 30, 2006
May 30, 2006
Copy link to clipboard
Copied
I have a need to update the value of a hidden field with the
value of a list menu. I researched the OnBlur and OnChange
JavaScript functions but did not find anything suitable. Here's the
deal:
If a user selects California from a State list menu, I need
to immediately update the the value of a hidden field with
'California' . (Both fields are on the same page) All of this has
to happen BEFORE the user Submits the page. Anytime they select the
state from the list menu the hidden field value has to change.
"PA" <webforumsuser@macromedia.com> wrote in message
news:e5ibjh$f45$1@forums.macromedia.com...
>I have a need to update the value of a hidden field with
the value of a
>list
> menu. I researched the OnBlur and OnChange JavaScript
functions but did
> not
> find anything suitable. Here's the deal:
>
> If a user selects California from a State list menu, I
need to immediately
> update the the value of a hidden field with 'California'
. (Both fields
> are on
> the same page) All of this has to happen BEFORE the user
Submits the
> page.
> Anytime they select the state from the list menu the
hidden field value
> has to
> change.
>
> Can anyone offer any suggestions?
>
> Thank you!
>
>
That looks like it may work! I'll check it out and get back
to you. Thanks for the quick response.
If I change the field type of Field2 to Hidden, I should get
the same results, right?
As long as I'm here: I may also need to store the selected
value as an ASP Session Variable. (In addition to, or as an
alternative to the hidden field) Is this possible?