This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Textbox validation in a .JSP file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Textbox validation in a .JSP file?" Watch "Textbox validation in a .JSP file?" New topic
Author

Textbox validation in a .JSP file?

abhiavi kumar
Greenhorn

Joined: Mar 13, 2013
Posts: 20
Hello there.

My .JSP page consists of these following javascript text boxes cardno, cardname, creditcard and creditcard2



There's a problem with the box "creditcard", I get prompted that the text box is empty, even if I enter values in it (and even if the other boxes are not empty either)

I was also wondering if there's a problem with using Javascript in a .JSP file?
abhiavi kumar
Greenhorn

Joined: Mar 13, 2013
Posts: 20

Also, How can I prompt the application to say something like "cardno you entered is invalid" by having it check against the values in "cardno" column in a table (oracle)?


Vivek K Jain
Greenhorn

Joined: Mar 17, 2013
Posts: 19

abhiavi kumar wrote:
Also, How can I prompt the application to say something like "cardno you entered is invalid" by having it check against the values in "cardno" column in a table (oracle)?




for that you need to use Ajax in your form...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63349
    
  70

NOne of this has anything to do with JSP. This post has been moved to a more appropriate location.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32633
    
215

As I asked in your other thread, what messages if any do you see in the JavaScript console? Also, remember that JavaScript runs on the client. It cannot access the database. If you want to check server state, you'll need to use AJAX.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Textbox validation in a .JSP file?
 
It's not a secret anymore!