Need your help, I am new with javascript, what do I wrong? javascript form validation suddenly doesn

Discussion in 'Javascript' started by francisco lopez, Dec 30, 2004.

  1. Yesterday I had a problem with a javascript to validate my form, but
    you helped my out yesterday and it works now perfectly!!! so thank
    you!!!

    the problem I have now is the following:

    I put my form now on the server and I changed following lines:

    I changed:
    form action="mailto:"

    to

    form action="/cgi-bin/formmail"

    and I added the following lines:

    <input type=hidden name=email value="">
    <input type=hidden name=url
    value="http://www.butacasalada.tk/main.htm">

    the problem is, that now the javascript doesn´t validate my form
    anymore,
    when I press the submit button it sends the form to the indicated
    email but without a validation and then jumps to the indicated url.

    what did I wrong?
    what can I do?

    hope you can help me with the last step now

    regards

    francisco lopez

    pd

    (when I erase the lines
    <input type=hidden name=url
    value="http://www.butacasalada.tk/main.htm">
    the form validation works again but than I don´t recive any email with
    the form-data and a new server page appears saying that the form was
    sent correctly, which is not correct because I don´t recive any email.

    you can see this an my webpage: www.butacasalada.tk under "cine"--"tu
    voto!"


    here you can see the script:


    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <script language="" type="text/javascript">
    <!--
    function chkFormular()
    [snip]
    //-->
    </script>
    </head>
    <body>
    <form action="/cgi-bin/formmail" method="post" name="formulario"
    id="formulario" onSubmit="return chkFormular()">
    <input type=hidden name=email value="">
    <input type=hidden name=url
    value="http://www.butacasalada.tk/main.htm">

    <input type="reset" name="Reset" value="borrar todo">
    <input type="submit" name="Submit2" value="enviar" >

    </form>
    </body>
    </html>
     
    francisco lopez, Dec 30, 2004
    #1
    1. Advertising

  2. francisco lopez

    RobG Guest

    francisco lopez wrote:
    [...]
    > <script language="" type="text/javascript">


    The empty language attribute tricked Safari, I suspect it is your
    problem. The language attribute has been depreciated for over 6 years
    (according to Mike Winter, I'll trust him on that), so get rid of it.
    Only type is required (and makes language redundant anyway).

    > <!--


    Don't hide scripts, that hasn't been necessary since about 1996. Even
    browsers that don't have JS know not to display scripts.

    > function chkFormular()
    > [snip]


    If you are going to remove the content of a function, keep the braces
    or an error will result:

    function chkFormular() {}

    > </script>
    > </head>
    > <body>
    > <form action="/cgi-bin/formmail" method="post" name="formulario"
    > id="formulario" onSubmit="return chkFormular()">
    > <input type=hidden name=email value="">


    All attribute values should be quoted, you can get away with it for now
    but get used to it for the future.

    <input type="hidden" name="email" value="">


    [...]

    Hope that helps!


    --
    Rob
     
    RobG, Dec 30, 2004
    #2
    1. Advertising

  3. Re: Need your help, I am new with javascript, what do I wrong? javascript form validation suddenly doesn?t work

    In article <>,
    says...
    > Yesterday I had a problem with a javascript to validate my form, but
    > you helped my out yesterday and it works now perfectly!!! so thank
    > you!!!
    >
    > the problem I have now is the following:


    You've got two fields called "email" in the same form.

    --
    Hywel http://kibo.org.uk/
    I do not eat quiche.
     
    Hywel Jenkins, Dec 30, 2004
    #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. Elhanan
    Replies:
    1
    Views:
    413
    Elhanan
    May 1, 2006
  2. folamour
    Replies:
    15
    Views:
    841
  3. Replies:
    4
    Views:
    175
    Martin Walke
    Sep 30, 2005
  4. Replies:
    12
    Views:
    328
  5. bnp
    Replies:
    4
    Views:
    353
Loading...

Share This Page