Javascript Help

Hello…I have this code

<?xml version=“1.0” encoding=“iso-8859-1”?>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<body>
<form id=“addressForm” name=“addressForm”
action=“submitted.html”
method=“post”
>
<p>
<table border=“0”>
<tbody>
<tr>
<td><label for=“name”>Name:</label></td>
<td><input type=“text” size=“20” name=“name” /></td>
</tr>
<tr>
<td><label for=“surname”>Surname:</label></td>
<td><input type=“text” size=“20” name=“surname” /></td>
</tr>
<tr>
<td><label for=“no”>Street Number:</label></td>
<td><input type=“text” size=“5” name=“no” />
<label for=“street”>Street:</label>
<input type=“text” size=“20” name=“street” /></td>
</tr>
<tr>
<td><label for=“city”>City:</label></td>
<td><input type=“text” size=“20” name=“city” /></td>
</tr>
<tr>
<td><label for=“city”>County:</label></td>
<td><input type=“text” size=“20” name=“county” /></td>
</tr>
<tr>
<td><label for=“postcode”>Post Code:</label></td>
<td><input type=“text” size=“7” name=“postcode” /></td>
</tr>
<tr>
<td><label for=“phone”>Phone:</label></td>
<td><input type=“text” size=“11” name=“phone” /></td>
</tr>

  &lt;tr&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;
      &lt;input type="submit" value="Submit" name="Submit" /&gt;
      &lt;input type="reset" value="Reset" name="Reset" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;

</table>
</p>
</form>
</body>

I need the javascript to check if the name,surname etc are letters and phone,postcode etc are numbers…Thank you in Advance…:slight_smile:

Hi shark_crazy, welcome to the forums,

I’m guessing you’re talking about client-side validation only (not secure, but can be helpful). If you have javascript capture the onsubmit event, you can have the script grab the input values and and run them through your validation.

What do you have so far?

P.S. Please put code examples in the bbcode tags eg.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form id="addressForm" name="addressForm"
action="submitted.html"
method="post"
>
<p>
<table border="0">
<tbody>

or at least turn off the smilies :<

Hello Mittineague…Yes I am talking about clicent-validation only…I don’t care if it’s safe or not…It’s for an exercise that I have to deliver tomorrow and it’s a bit of an emergency…I know hardly nothing about javascript,so all I want is to get code…Thank you once more…

About the code in my first post…I cannot see the Edit button to change it…