Forum Moderators: coopster
POP-UP has div.visibleNotifyMsg
and notifyErrors function is:
function notifyErrors(id, errors, visibleStateCSS) {
object = document.getElementById(id);
object.innerHTML = '<div class=clear></div><div class="floatleft" style="padding-left: 40px;padding-top: 30px;">Please change your errors<ul class="msgerror">';
object.innerHTML += errors.join("\n");
object.innerHTML += '</ul></div><div class=clear></div>';
object.className = visibleStateCSS;
} and
if(errStack.length > 0)
{
notifyErrors('notifyPopup', errStack, 'visibleNotifyMsg');
return false;
}
if(!frm.email.value.match(emailRegex))
{
errStack.push("<li>E-mail is not valid!</li>");
frm.email.focus();
}
On form is at the end:
<div id="notifyPopup" class="hiddenState" align="center"></div>
Try the CSS forum:
[webmasterworld.com...]
[edited by: MichaelBluejay at 6:52 pm (utc) on Mar. 22, 2009]
Here's the smallest code I can write to do what you're asking about:
<html>
<script type=text/javascript>
function checkForm(email) {
pattern=/^[\w-]+[\w.-]*@[\w-]+[\w.-]*\.[\w-]{2,4}$/;
if (!pattern.test(email)) {
document.getElementById('error').innerHTML="That doesn't look like a valid email address.";
return false;
}
}
</script>
<div id=error></div>
<form action=script.pl method=post onsubmit="return checkForm(this.email.value)">
<p><input name=email>
<p><input type=submit value=Submit>
</form>
</html>