Hi, Oscar.
Is quite simple...
To check fi the fields are filled, you must use javascript.
Put in your button "onClick" a call to a method like this:

<input type="button" ... onClick="checkFields()" ... >

<script>

function checkFields() {
        if (document.myForm.myField1.value == "") {
                alert("Field1 must be filled.");
                document.myForm.myField1.focus();

        } else if (document.myForm.myField2.value == "") {
                alert("Field2 must be filled.");
                document.myForm.myField2.focus();

        } else {
                submit(); // Your form must submit to the page where you have the bean
that authenticate in the database.
        }
}

</script>

Kisses,
Luciana.

-----Original Message-----
From: A mailing list about Java Server Pages specification andreference
[mailto:[EMAIL PROTECTED]]On Behalf Of Sello Mathibe
Sent: Friday, February 09, 2001 7:03 AM
To: [EMAIL PROTECTED]
Subject: Querying a Database in JSP.


> Hi. I've created a JSP login page where I've got a Username field and a
> Password field. I've created a table in my Access database, I've also
> created a DSN and can connect to it in my BEAN. Now my problem is that: I
> want to check if the user/client has entered some data on both fields, if
> he submit before he enters some data, I want to through an error message
> or alert in JavaScript. If something is entered on both fields, I want to
> validate that data from the database through the bean.
>
> Can somebody help me cause, I'm trying to create a huge application, but
> I'm stuck at the beginning!
> Thank You
> Oscar
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
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

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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

Reply via email to