View Full Version : Form to Email

08-01-2002, 05:51 AM
I want to create a form like this:


Anyone can help me where can I find such coding? I found that it use asp to do the checking. If i want to use javascript to do this function, can I and where can I find more information about this? Thanks ^_^

08-01-2002, 04:20 PM
If you just want to use javascript to check to see if the fields are filled in this is pretty easy. If you want to display a message to the user it's just a combination of a few functions. I wrote this a few weeks ago for someone else. It shows the errors in a new window, not in the one the form was in. But it might serve your purpose, or give you an idea on where to start. It only does required validation, it could be modified to check formats, and lenghts with a couple more funtions.

<body >
<form name=temp method="post" action="popUpError.html" onSubmit="return validateForm(this)">
<b>First</b>: <input type="text" name="Question1" value=""><br>
<b>Second</b>: <input type="text" name="Question2" value=""><br>
<b>Third</b>: <input type="text" name="Question3" value=""><br>
<input type="submit" name="submit" value="Send it">

<script language="JavaScript" type="text/javascript">
function validateForm(theForm){
errMsg = ""
errMsg = errMsg + isRequired(theForm.Question3, "Third Question");
errMsg = errMsg + isRequired(theForm.Question2, "Second Question");
errMsg = errMsg + isRequired(theForm.Question1, "First Question");
if (errMsg.length > 0){
return false;
return true;

function isRequired(item, displayName){
if (item.value == ""){
return "\n <b>" + displayName + "</b> is a required field<br>";
return "";

function showErrorWindow(errorMessage){
errwin=window.open("","ErrorWindow"," toolbar=no,status=yes,maximize=no,menubar=no,scrollbars=yes,width=500,height=500");
errwin.document.writeln('\n<a href="javascript:window.close();">Close</a> this window, and fill in the appropriate fields.\n</body></html>');



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum