Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Location
    Bay Area -USA
    Posts
    1,738

    Changing the value of a hidden Form value...

    Hey I have to change the value of a hidden form element when a user selects a different radio button. Here is my code:

    PHP Code:
    <script language='JavaScript'>
    function 
    UpdateForm() {
    window.Signup.encrypted.value 'New_value_here';
    }
    </script> 
    then below is this
    PHP Code:
    <input type="radio" name="package_type" value="gold" onChange="UpdateForm();">
    <
    input type="radio" name="package_type" value="silver" onChange="UpdateForm();">
     <
    input type="hidden" name="encrypted" value="first_value"
    Anyhelp would be great!

    It doesnt
    <<< Please see Forum Guidelines for signature setup. >>>

  2. #2
    Join Date
    Mar 2005
    Posts
    48

    Re: Changing the value of a hidden Form value...

    PHP Code:
    <script language='JavaScript'>
    function 
    updateForm(radioControl) {
    document.forms['frm'].parm1.value radioControl.value;
    alert(document.forms['frm'].parm1.value);
    }
    </script> 
    PHP Code:
    <form id="frm" name="mystuff">
    <
    input id="parm1" name="waddayawant" type="hidden" value="original"/>
    <
    input type="radio" name="package_type" value="gold" onclick="updateForm(this);"/>
    <
    input type="radio" name="package_type" value="silver" onclick="updateForm(this);"/>
    </
    form

  3. #3
    Join Date
    Jun 2004
    Location
    Bay Area -USA
    Posts
    1,738
    Thanks :-D
    <<< Please see Forum Guidelines for signature setup. >>>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •