Hello:
Javascript is the solution.
The code HTML for the form is:
<form action="YourJSP.jsp" method="POST" name="alta">
e-mail: <input type="Text" name="email" size="20" maxlength="50">
<br>
<input type="button" value="Registrarme" name="Button"
onclick="javascript:chequear()" >
</form>
The code javascript for test de email is:
// The script use a regular expresion for test de string.
function chequear()
{
if (document.layers||document.all) {
var filter=/^.+@.+\..{2,3}$/
var str = document.alta.email.value;
if (filter.test(str)){
document.alta.submit();
}
else{
alert("The e-mail is bad "+ str)
document.alta.email.focus();
return;
}
}
else{
if(document.alta.email.value.length<6){
alert("The e-mail is bad ")
document.alta.email.focus();
return;
}
else document.alta.submit();
}
}
</script>
>
> -----Original Message-----
> From: Jan D. Herzhoff [mailto:[EMAIL PROTECTED]]
> Sent: 20 September 2000 18:56
> To: [EMAIL PROTECTED]
> Subject: check emailadress
>
> Hi,.
>
> I am a newbie in JSP and I would like to create a form with an error script.
> If someone types an email adress without an "@" for example an error code
> should appear.
>
> How can I do this or what else do I have to check?
>
> Thanks and best regards,
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
--
-----------------------------
Miguel Angel Fernandez Roiz
LoboCom Sistemas, s.l.
web: http://www.lobocom.es
e-mail: [EMAIL PROTECTED]
-----------------------------
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets