Forum Home
Press F1
 
Thread ID: 24071 2002-09-02 23:18:00 Changing form field to require "@" symbol honeylaser (814) Press F1
Post ID Timestamp Content User
75953 2002-09-02 23:18:00 I'm in the middle of creating a form using Frontpage and XTRA FormMail for opt-in Mailouts/Newsletters from a w/site.

How do I go about creating a rule that if someone enters data into the "email address" field without an @, it won't accept it? I know I've seen this on sites, and as you click into the next field it says "You have entered an invalid email address" or something like that.

Any ideas? I've googled my heart out but its not returning the kind if responses I was hoping for.

Thanks
honeylaser (814)
75954 2002-09-02 23:40:00 Is this (javascript.internet.com) what your looking for? :) codegirl (1038)
75955 2002-09-03 00:45:00 thats exactly what I need, but it won't work. perhaps I need the form to be live to get it working? honeylaser (814)
75956 2002-09-03 00:51:00 Hi. You can do it in your form field with the 'required' tag, similar to this:

<form action ="yoursite method="POST">
<INPUT TYPE=hidden name="recipient" VALUE="youraddress@yoursite.co.nz">
<INPUT TYPE=hidden name="required" value="email">
Greg S (201)
75957 2002-09-03 00:52:00 You may have to upload it first, not sure. I would have thought it would work just on your local drive.
How is it not working? Is it bring up a javascript error?
codegirl (1038)
75958 2002-09-03 00:53:00 My post above assumes the text field for the email address is called "email". And it doesn't need to be live for either way of doing it to work. Greg S (201)
75959 2002-09-03 01:41:00 This is in part what I have at the moment. I've tried altering the code in various ways, but still can't get the darned thing to work!

<html>

<head>

</head>

<body>

<table width="530" border="0" height=" 1">
<tr>
<td height="25" align="left" width="1" >
<div align="left" ></div>
</td>
<td height="25" align="justify" width="170" >
<font style="font-size: 9pt"> Company * </font> </td>
<td align="center" width="485" height="25">
<span style="font-size: 9pt">
<input name="_company1" size="45" style="float: left"></span> <font style="font-size: 9pt">
</font>
</td>
</tr>
<tr>
<td align="left" valign="middle" width="1" height="24"> </td>
<td align="justify" valign="middle" width="170" height="24">
<font style="font-size: 9pt"> Contact Name * </font> </td>
<td align="center" width="485" height="24">
<span style="font-size: 9pt">
<input name="_ContactName1" size="45" style="float: left"></span> <font style="font-size: 9pt">
</font>
</td>
</tr>
<tr>
<td align="left" valign="middle" height="28" width="1" > </td>
<td align="justify" valign="middle" height="28" width="170" >
<font style="font-size: 9pt"> Email Address * </font> </td>
<td align="center" height="28" width="485" >






<span style="font-size: 9pt">
<input name="_EmailAddress1" size="45" style="float: left"></span> </td>
</tr>
<tr>
<td align="left" valign="middle" width="1" height="24"> </td>
<td align="justify" valign="middle" width="170" height="24">
<span style="font-size: 9pt"> Telephone *</span> </td>
<td align="center" width="485" height="24">
<span style="font-size: 9pt">
<input name="_Telephone1" size="45" style="float: left"></span> <font style="font-size: 9pt">
</font>
</td>
</tr>
<tr>
<td align="left" valign="middle" width="1" height="24"> </td>
<td align="justify" valign="middle" width="170" height="24">
<span style="font-size: 9pt"> Fax</span> </td>
<td align="center" width="485" height="24">
<span style="font-size: 9pt">
<input name="_Fax1" size="45" style="float: left"></span> <font style="font-size: 9pt">
</font>
</td>
</tr>
<tr>
<td align="left" valign="middle" width="1" height="5"> </td>
<td align="justify" valign="middle" width="655" height="6" colspan="2" rowspan="2">
<p align="left" >
</td>
</tr>
<tr>
<td align="left" valign="middle" width="1" height=" 1"> </td>
</tr>
<tr>
<td align="left" valign="middle" width="656" height="77" colspan="3">
<table width="104%" border="0" height=" 1">
<tr>
<td width="98%" align="left" valign="top" rowspan="2" height=" 1">
<p align="center">

<input type="reset" name="Submit2" value="Reset Form" style="border-style: solid; border-width: 1">
<input type="submit" name="Submit" value="Submit Form" style="border-style: solid; border-width: 1">

</td>
<td width="4%" height=" 1">
</td>
</tr>
<tr>
<td width="4%" height=" 1">
</td>
</tr>
</table>
</td>
</tr>
</table>

</body>

</html>
honeylaser (814)
75960 2002-09-03 01:44:00 > <input type="reset" > <input type="reset" name="Submit2" value="Reset Form" style="border-style: solid; border-width: 1>

Sorry, that should be <input type="reset" name="Reset1" value="Reset Form" style="border-style: solid; border-width: 1">
honeylaser (814)
75961 2002-09-03 01:56:00 honeylaser,

You have no <form> tag? An html form needs this tag to tell it what to do with the field data, i.e <form action ="yoursite method="POST"> as Greg mentioned.

If you want to use the javascript code I gave you the link to, you will need to copy the code from that page and read the instructions.
The actual javascript (step one) needs to go between the <head> tags at the top of your html page. You will also need to add a few attributes to your current tags, e.g. rename your email input box to "emailAddr", and add the "onSubmit" attribute to your <form> tag.

Hope this makes sense :)
codegirl (1038)
75962 2002-09-03 02:00:00 Hmm - FrontPage has some bizzare ways of creating code... It appears that you're missing the Form Action tag in the first place, as well as the Post. Greg S (201)
1 2