GeeCON Prague 2014*
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


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: 61318
    
  66

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: 30598
    
154

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.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
GeeCON Prague 2014
 
subject: Textbox validation in a .JSP file?