2 Replies - 538 Views - Last Post: 20 December 2012 - 07:26 AM

#1 pamelariggle  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-December 12

Unable to get a validation page for my code

Posted 19 December 2012 - 05:57 PM

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<!--
	
-->
<!--
	Web Page Title and background settings
-->
<title>Kudler Fine Foods Customer Demographic</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">

<script type="text/javascript">

<!-- Form Submission check -->

function submitForm() {
if (document.forms[0].fname.value == ""
	|| document.forms[0].lname.value == ""
	|| document.forms[0].address1.value == ""
	|| document.forms[0].city.value == ""
	|| document.forms[0].city.value == ""
	|| document.forms[0].state.value == ""
	|| document.forms[0].zip.value == ""
	|| document.forms[0].phone.value == "")
	
{
window.alert("You must enter your information.");
	return false;
}

return true;
}
</script>
</head>

<body style="color: black; margin:0"; background="ob016.jpg">
<form name="request" id="request" 
onsubmit="return submitForm();"
onreset="return confirmReset();"

enctype="application/x-www-form-urlelncoded">

<table border="0" cellspacing="0" cellpadding="5" width="620" >

<thead style="font-family: sans-serif">

<!--
	Company Logo and Heading
-->

<tr>
   <td valign="top" width="180" rowspan="2">
	 
   </td>
   <td style="font-size: 1.2em; color: black; font-weight: bold; font-style: italic"
	   valign="top" align="center" >
		 Kudler Fine Foods Customer Information Form
   </td>
</tr>
</thead>

<!-- Customer Information Heading -->
<tr>
   <td style="font-family: sans-serif; font-size: large; font-weight: bold"
	   colspan="2" width="100%">
		 Customer Information
   </td>
</tr>
<tr>
   <td colspan="2">
	  <hr style="color: blue; background-color: blue; height: 1" >
   </td>
</tr>


<!-- Contact Information to be input -->
<tr>   
   <td valign="top" colspan="2">
   <table>
	<tr>
		<td width="100"><label for="fname">First Name</label></td>
		<td><input type="text" name="fname" id="fname" size="30" >
		<td><label for ="lname">Last Name</label></td>
		<td><input type="text" name="lname" id="lname" size="30" >
		</td>
	</tr>
	<tr>
		<td><label for ="address1">Address </label></td>
		<td><input type="text" name="address1" id="address1" size="60" ></td>
	</tr>
	
	</tr>
	<tr>
		<td><label for="city">City</label></td>
		<td><input type="text" name="city" id="city" size="40" >
		<label for="state">State</label>
		<input type="text" name="state" id="state" size="3" >
		<td><label for="zip">ZIP</label></td>
		<td><input type="text" name="zip" id="zip" size="10" maxlength="10" >
		</td>
	</tr>
	<tr>
	<td><label for="phone">Phone</label></td>
		<td><input type="text" name="phone" id="phone" size="12" >
	</td>
	</tr>
	<tr>
		<td><label for="email">Email Address</label></td>
		<td><input type="text" name="email" id="email" size="40" ></td>
	</tr>
	
	</table>
   </td>
	<tr>
		<td valign="top">
		<input type="checkbox" name="use" id="mail" value="mail" >
		<label for="mail">Add me to your Mailing List</label><br >
		</td>
	</tr>
<tr>
   <td colspan="2">
	  <hr style="color: blue; background-color: blue; height: 1" >
   </td>
</tr>
<!--
	Customer Comments Section
-->
<tr>
<td width="100" valign="top">
<label for="comments">Comments</label>
</td>
<td valign="top">
<textarea name="comments" id="comments" rows="6" cols="50">
</textarea>
</td>
</tr>

<!-- Buttons for submission or cancelation -->
<tr>
   <td valign="top" colspan="2" align="center">
   <input type="submit" value="Submit" >
   <input type="reset" value="Cancel" >
   </td>
   
</tr>

<!-- Company Name and locations -->
<tr style="background-color: blue">
   <td colspan="2" align="center" valign="bottom">
	  <address style="font-family: sans-serif; font-size: 0.6em; font-style: normal; color: white">
	  Kudle Fine Foods  Shopping the World for the Finest Foods  La Jolla  Del Mar  Encinitas 
	  </address>
   </td>
</tr>
</table>


</form>
</body>

</html>


I have tried to add different information to get the submit button to go to a validation page and have not been able to get it to happen. Not sure where I need to put information or what I need to include.

Is This A Good Question/Topic? 0
  • +

Replies To: Unable to get a validation page for my code

#2 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: Unable to get a validation page for my code

Posted 19 December 2012 - 06:20 PM

Setup a script to get the information and validade it, you can find a lot of them with a simple Google search. You can either use AJAX to submit the information to the script and check if the it's valid then submit the form, or use the awesome HTML5 Forms.

This post has been edited by nathanpc: 19 December 2012 - 06:20 PM

Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: Unable to get a validation page for my code

Posted 20 December 2012 - 07:26 AM

Your form element needs an action; that is a page to which to submit the entered data.

Relevant W3C Documentation.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1