Buy Now
Sign in

HELP!!

junjun , March 13 2007, 11:23
J
junjun 1
March 13 2007, 11:23 #176
Hi there!

Need a great help from u guys here!!

Below are my codes:


<html>
<head>
<title>JavaScript Form Validation Example</title>
<style type="text/css">
  body
  {
  background:white;
  font-size:12px;
  font-family:arial;
  }
  table
  {
  background:navy;
  color:white;
  font-weight:bold;
  }
  </style>

<script language="javascript" type="text/javascript">


function validateForm(contact)
{

if(document.forms.contact.fullName.value=="")
{
alert("Please enter your full name.");
document.forms.contact.fullName.focus();
return false;
}

if(document.forms.contact.email.value=="")
{
alert("Please enter your email address.");
document.forms.contact.email.focus();
return false;
}

if(document.forms.contact.phoneNum.value=="")
{
alert("Please enter your phone number.");
document.forms.contact.phoneNum.focus();
return false;
}

}

</script>


</script>

</head>

<body>
<form name="contact" method="post" action="" onSubmit="return validateForm(contact);">
<table border="1">

<tr>
<td>Name:</td>
<td><input type="text" name="fullName" length="25"></td>
</tr>

<tr>
<td>Email:</td>
<td><input type="text" name="email" length="25"></td>
</tr>

<tr>
<td>Phone Number</td>
<td><input type="text" name="phoneNum" length="25"></td>
</tr>

<tr>
<td><input type="submit" name="submit" value="Submit"></td>
<td><input type="reset" name="reset"></td>
</tr>

</table>
</form>

</body>
</html>




I tried many times to inserted the codes inside my site, although i can see the form, but my "form validator" doesn't work


Can somebody guide me on how to insert those codes inside my com_chronocontact / edit site? How to divide them and place piece by piece inside my site??

Thx thx!
admin 28
March 13 2007, 18:16 #177
u have 2
</script>
tags

cheers

Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!