spacer
NC State University Home  College of Textiles Home
Search this site:
 
Intranet
Submit A Calendar Event
IT Projects
CAT 6 Rewiring Project
Computer/Software Order Status
Distance Education Classes
Use the Image Database
Departments
Textile & Apparel Technology & Management
Textile Engineering, Chemistry & Science
Textile Extension Education For Economic Development
TexLabs - Analytical and Product Development Services
Academic Programs
Business Services
Student & Career Services
Centers, Programs & Initiatives
People
Intranet
ITT Alliance
Comments/Suggestions
Home --> Information Technology

JS Form Validation

<!--- This javascript will check for form errors --->
<SCRIPT language="JavaScript">
function checkForm(){
theform=document.contact
// Check that the form has a full name specified in the field called "name"
if (theform.name.value==""){
alert("Please provide your name.")
theform.name.focus()
return false;
}
// Check that the form has an email specified in the field called "email"
if (theform.email.value==""){
alert("Please provide your email address.")
theform.email.focus()
return false;
}
return true;
}
</SCRIPT>

<form name="contact" action="formaction.cfm" method="post" onsubmit='return checkForm();'>
<p>Name:
<input name="name" type="text" id="name" size="30">
<br>
Email Address:
<input name="email" type="text" id="email" size="30">
< /p>
<p>
<input type="submit" name="Submit" value="Submit">
< /p>
</form>


 
TCO
Support
Student Computing
Computer Labs
Nomadic/Wireless Coverage
Order Status
TCO Staff
 
Media Services
CD/DVD Media
Online Tutorials
Media Check History
Streaming/Recording Links
Web Services
Current/Past Projects
Server Structure
Wolfware/WebCT/Webassign
Free Images and Music
Code Examples
Cold Fusion Help
spacer
spacer