How do I redirect with a checkbox?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sunshine

    #1

    How do I redirect with a checkbox?

    I have a form with a submit button. My idea was to have a checkbox.
    In the validateform() right before the return true have it redirect to
    another page if the checkbox was selected. I can't get the code to
    work. Any suggestions?

    Here's my code:

    <FORM method="POST" ACTION="DoLogin .asp" name="This" onSubmit="retur n
    validateForm()" >
    <input type="hidden" name="strNew" id="strNewPass " value="">
    USERID:
    <INPUT TYPE="text" NAME="strUser" VALUE="" SIZE="50" MAXLENGTH="50">
    PASSWORD:
    <INPUT TYPE="password" NAME="strPass" VALUE="" SIZE="50"
    MAXLENGTH="50">
    <input type="checkbox" name="ChgPasswo rd">Change Password
    </td>
    </tr>
    </table>
    </FORM>

    SCRIPT
    If (eval("Document .This.ChgPasswo rd.Checked == True"))
    {
    Response.Redire ct("password.as p");
    }


    Thanks for your help.. I'm pretty new to this..

  • Joakim Braun

    #2
    Re: How do I redirect with a checkbox?

    "Sunshine" <sunshinevaldes @yahoo.com> skrev i meddelandet
    news:1106156238 .711631.114850@ c13g2000cwb.goo glegroups.com.. .[color=blue]
    > I have a form with a submit button. My idea was to have a checkbox.
    > In the validateform() right before the return true have it redirect to
    > another page if the checkbox was selected. I can't get the code to
    > work. Any suggestions?
    >
    > Here's my code:
    >
    > <FORM method="POST" ACTION="DoLogin .asp" name="This" onSubmit="retur n
    > validateForm()" >
    > <input type="hidden" name="strNew" id="strNewPass " value="">
    > USERID:
    > <INPUT TYPE="text" NAME="strUser" VALUE="" SIZE="50" MAXLENGTH="50">
    > PASSWORD:
    > <INPUT TYPE="password" NAME="strPass" VALUE="" SIZE="50"
    > MAXLENGTH="50">
    > <input type="checkbox" name="ChgPasswo rd">Change Password
    > </td>
    > </tr>
    > </table>
    > </FORM>
    >
    > SCRIPT
    > If (eval("Document .This.ChgPasswo rd.Checked == True"))
    > {
    > Response.Redire ct("password.as p");
    > }[/color]

    if(document.for ms["This"].ChgPassword.ch ecked){

    // do stuff
    }

    But naming any object "This" might not be a great idea.

    Joakim Braun


    Comment

    Working...