[Javascript] Form validation
allard schripsema
allard-schripsema at procergs.rs.gov.br
Fri Feb 20 12:58:22 CST 2004
The first error is the onclick in the href
the next error is in the formfield:
You are closing the write parenthesis to early, you have 2 of them!
example:
val.document.write('<td class="c2">' + window.document.forms[0].first.value) + '</td></tr>');
1 2!
function validate(){
var val = window.open("","","width=300,height=250,scrollbars,menubar");
val.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <head> <title>Form Validation</title>');
val.document.write('<style type="text/css">\n body{font-family: arial, helvetica, sans-serif; background-color:#cccccc; text-align:center;} td{padding:5px;} td.c1{text-align:right;} td.c2{text-align:left;} </style></head>');
val.document.write('<body>')
val.document.write('<table><tr><td colspan="2">Please validate form contents:</td></tr>')
val.document.write('<tr><td class="c1">First Name:</td>');
val.document.write('<td class="c2">' + window.document.forms[0].first.value) + '</td></tr>');
val.document.write('<tr><td class="c1">Last Name:</td>');
val.document.write('<td class="c2">' + window.document.forms[0].last.value) + '</td></tr>');
val.document.write('<tr><td class="c1">Email:</td>');
val.document.write('<td class="c2">' + window.document.forms[0].email.value) + '</td></tr>');
val.document.write('<tr><td colspan="2"><form>');
val.document.write('<input type="button" value="Information Correct: Submit" onclick="opener.cgiSubmit(); opener.close(); window.close();" /> <input type="button" value="Revise Form" onclick="window.close();" /></td>');
val.document.write('</form></td></tr></table>');
val.document.write('</body></html>');
val.document.close();
}
----- Original Message -----
From: Chris Tifer
To: [JavaScript List]
Sent: Friday, February 20, 2004 3:53 PM
Subject: Re: [Javascript] Form validation
Seeing as that's a string, I wouldn't think that would be a problem. Try escaping it to test if that would help (although I never considered - to be a special character although I guess it could be considered so since it's the expression used for subtraction.
I normally use underscores instead of dashes when naming files so never ran into something like this.
Chris Tifer
----- Original Message -----
From: allard schripsema
To: [JavaScript List]
Sent: Friday, February 20, 2004 1:48 PM
Subject: Re: [Javascript] Form validation
this is the line that generates the error
<a href="#" onclick="window.open('p-js-fval.htm','p-js-fval','top=10,left=200,width=500,height=350,resizable,scrollbars');">Form Validation</a>
If you change 'p-js-fval.htm','p-js-fval' to names without the "-" it works .
Anybody knows why?
----- Original Message -----
From: Ira S. Mark
To: JavaScript list post
Sent: Friday, February 20, 2004 3:32 PM
Subject: [Javascript] Form validation
List: I have my script debugged successfully (debugger moz1.6win) but the functions are not calling. The coding seems pretty straight forward, form validation, viewer to review entries on separate window. I would be grateful if someone could take a look.
http://www.ismdesigns.com/test/portfolio/p-js.htm >Form Validation. Neither of the input buttons on p-js-fval.htm works, "Submit" or "Clear".
Thanks, Ira
--------------------------------------------------------------------------
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
----------------------------------------------------------------------------
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
------------------------------------------------------------------------------
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040220/a3f67e5d/attachment.htm>
More information about the Javascript
mailing list