Quote:
Thank you for your help...but I still cant get it to work I checked the new javascript you posted but it seems the same as my old one?
In any case, I did what you said and I am still getting that anooying pop-up box saying email is invalid. Here is the code Im using:
|
I have just pasted your code into my "contactus.tpl" and I'm getting the error message. I then restored the
original help/contactus.tpl file, and deleted the items one by one to match your code. Each time I deleted an entry, I sent the email,
without any error messages.
If you are using an edititor other than Admin/Edit templates, your editor may be adding non print characters to the template. Here is the code I used to match your template.
Quote:
{* $Id: contactus.tpl,v 1.15 2002/09/12 10:25:45 verbic Exp $ *}
{literal}
<script>
function checkEmailAddress(field) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.go v)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail) {
return true;
} else {
alert("E-mail address is invalid! Please correct");
field.focus();
field.select();
return false;
}
}
</script>
{/literal}
{if $smarty.get.mode eq "update"}
{$lng.txt_contact_us_header}
{/if}
{capture name=dialog}
{if $smarty.get.mode eq "update"}
<table width=100% border=0 cellspacing=0 cellpadding=2>
<form action="help.php?section=contactus&mode=update&act ion=contactus" method=post name=registerform>
<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_title}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<select name=title>
{section name=title loop=$name_titles}
<option {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</option>
{/section}
</select>
</td>
</tr>
<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_first_na me}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=firstname size=32 maxlength=32 value="{$userinfo.firstname}">
{if $fillerror ne "" and $userinfo.firstname eq ""}<font class=StarStyle><<</font>{/if}
</td>
</tr>
<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_last_nam e}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=lastname size=32 maxlength=32 value="{$userinfo.lastname}">
{if $fillerror ne "" and $userinfo.lastname eq ""}<font class=StarStyle><<</font>{/if}
</td>
</tr>
<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_email}</td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=email size=32 maxlength=128 value="{$userinfo.email}">
{if $fillerror ne "" and $userinfo.email eq ""}<font class=StarStyle><<</font>{/if}
</td>
</tr>
<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_subject} </td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<input type=text name=subject size=32 maxlength=128 value="{$userinfo.subject}">
{if $fillerror ne "" and $userinfo.subject eq ""}<font class=StarStyle><<</font>{/if}
</td>
</tr>
<tr valign=middle>
<td class="TableCenterCustomerForm">{$lng.lbl_message} </td>
<td><font class=StarStyle>*</font></td>
<td nowrap>
<textarea cols=48 rows=12 name=body>{$userinfo.body}</textarea>
{if $fillerror ne "" and $userinfo.body eq ""}<font class=StarStyle><<</font>{/if}
</td>
</tr>
<tr valign=middle>
<td></td>
<td></td>
<td nowrap>
{include file="buttons/submit.tpl"}
</td>
</tr>
<input type=hidden name=usertype value="{$usertype}">
</form>
</table>
{else}
{$lng.txt_contact_us_sent}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_contact_us content=$smarty.capture.dialog extra="width=100%"}
|
This is the
/help/help.php Code:
Quote:
$filerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));
|
Quote:
This is the disabled existing error checking code
# $fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"]));
|
I then copied your code back into "contactus.tpl" and the error message was back. I suggest you restore the original file and delete un-wanted items using Admin/template editor (if you are not already doing so), and double check the "/help/help.php" file.
Regards,