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

F

francisco lopez

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:[email protected]"

to

form action="/cgi-bin/formmail"

and I added the following lines:

<input type=hidden name=email value="(e-mail address removed)">
<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="(e-mail address removed)">
<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>
 
R

RobG

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="(e-mail address removed)">

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="(e-mail address removed)">


[...]

Hope that helps!
 
H

Hywel Jenkins

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top