hi there. what's wrong with this statement? It's in a function and when the user clicks to submit...I want it to check for a vaild email only if they entered one. My default value is "email". So it shouldn't trigger this statement if the value is "email" or "".
if (document.frmSushiBar.txtEmail.value != "" || document.frmSushiBar.txtEmail.value != "email"
{
if (document.frmSushiBar.txtEmail.value.search("@"
== -1 || document.frmSushiBar.txtEmail.value.search("[.*]"
== -1)
{
document.frmSushiBar.txterror.value = "Please enter an email";
document.frmSushiBar.txterror.style.display = 'inline';
return false
}
}
**************************************************
*
Next question.
I have a input who's display property is set to "none". And when you click on a button, the property is set to ''. But when I want to clear my form...I have a function which is suppose to set it back to
"none".
<script language="javascript">
function reset()
{
document.frmSushiBar.txtNick.value="nick/handle"
document.frmSushiBar.txtEmail.value="email"
document.frmSushiBar.txtWebsite.value="document.frmSushiBar.txtMessage.value="message"
if (document.frmSushiBar.txterror.style.display = 'inline')
{
document.frmSushiBar.txterror.style.display = 'none';
}
}
</script>
Thanks!!!
if (document.frmSushiBar.txtEmail.value != "" || document.frmSushiBar.txtEmail.value != "email"
{
if (document.frmSushiBar.txtEmail.value.search("@"
{
document.frmSushiBar.txterror.value = "Please enter an email";
document.frmSushiBar.txterror.style.display = 'inline';
return false
}
}
**************************************************
*
Next question.
I have a input who's display property is set to "none". And when you click on a button, the property is set to ''. But when I want to clear my form...I have a function which is suppose to set it back to
"none".
<script language="javascript">
function reset()
{
document.frmSushiBar.txtNick.value="nick/handle"
document.frmSushiBar.txtEmail.value="email"
document.frmSushiBar.txtWebsite.value="document.frmSushiBar.txtMessage.value="message"
if (document.frmSushiBar.txterror.style.display = 'inline')
{
document.frmSushiBar.txterror.style.display = 'none';
}
}
</script>
Thanks!!!