javascript form action = send form details to ASP page

Discussion in 'Javascript' started by iam247@gmail.com, Aug 7, 2005.

  1. Guest

    Hi

    In my prototype asp page (with no javascript and no password
    validation, I have a registration form with the following action:

    <form name="form" method="post" action="RegDetails.asp">

    This works fine, the form details are collected by RegDetails.asp

    I am attempting to include javascript server side validation for the
    pasword, which obviously requires password and password2 fields (to be
    verified). I have used the script available at:

    http://javascript.internet.com/forms/val-pass.html

    It works fine in a new blank page with the form action:

    <form name=myForm onSubmit="return validatePwd()">

    The final stage in this javascript demo form displays an alert box:

    else {
    alert('Nice job.');
    return true;


    When I change the first line of my original form to:

    <form name=myForm onSubmit="return validatePwd()">

    how do I get my original action of - action="RegDetails.asp" instead
    of this alert box?

    Thanks ColinK
     
    , Aug 7, 2005
    #1
    1. Advertising

  2. Randy Webb Guest

    said the following on 8/6/2005 8:10 PM:
    > Hi
    >
    > In my prototype asp page (with no javascript and no password
    > validation, I have a registration form with the following action:
    >
    > <form name="form" method="post" action="RegDetails.asp">
    >
    > This works fine, the form details are collected by RegDetails.asp
    >
    > I am attempting to include javascript server side validation for the
    > pasword, which obviously requires password and password2 fields (to be
    > verified). I have used the script available at:
    >
    > http://javascript.internet.com/forms/val-pass.html
    >
    > It works fine in a new blank page with the form action:
    >
    > <form name=myForm onSubmit="return validatePwd()">
    >
    > The final stage in this javascript demo form displays an alert box:
    >
    > else {
    > alert('Nice job.');
    > return true;
    >
    >
    > When I change the first line of my original form to:
    >
    > <form name=myForm onSubmit="return validatePwd()">
    >
    > how do I get my original action of - action="RegDetails.asp" instead
    > of this alert box?


    Add the action attribute back to your form, and change the else to look
    like this:

    else{
    return true;
    }


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
     
    Randy Webb, Aug 7, 2005
    #2
    1. Advertising

  3. ASM Guest

    wrote:
    > The final stage in this javascript demo form displays an alert box:
    >
    > else {
    > alert('Nice job.');
    > return true;


    here you cant notice 'return true'
    that means : OK, authorized submitting

    > When I change the first line of my original form to:
    >
    > <form name=myForm onSubmit="return validatePwd()">


    that's wrong

    > how do I get my original action of - action="RegDetails.asp" instead
    > of this alert box?


    the alert won't stop the call to your asp (if all is correct)

    and you have to write :

    <form name="form" action="RegDetails.asp"
    onSubmit="return validatePwd()" method="post">


    --
    Stephane Moriaux et son [moins] vieux Mac
     
    ASM, Aug 7, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    Show Details/Hide Details link button

    =?Utf-8?B?Sm9l?=, Mar 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    911
    dkode
    Mar 13, 2006
  2. Joe Bloggs
    Replies:
    1
    Views:
    841
    Sudsy
    Aug 3, 2003
  3. John
    Replies:
    0
    Views:
    918
  4. Sam Vel

    Hide Action details at Form section

    Sam Vel, Mar 13, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    2,035
    George
    Mar 13, 2009
  5. Replies:
    7
    Views:
    636
Loading...

Share This Page