• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing textfield bgcolour upon entering data

 
Rouven Withake
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I have the following problem and was wondering if I could do this with JSP.

Basically I have a form with which I enter data into a database.
In the form are textfields. One of the textfields is for numbers only.
Upon entering numbers within the textfield I want it to change its background colour. For example: If its below 8 digits the bgcolour is yellow , if its exactly 8 its green and if its over 8 its red.

Is it possible to do this with JSP ?
If yes , how ?

Thanks for your help.

Cheers,

Rouven
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34656
366
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rouven,
You actually want to use JavaScript on the page to update the CSS for that textfield. I'll move this to our HTML forum where they are experts at that sort of thing.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe this is what you wanted:



You probably want to change the colors so they are lighter in color. I picked the basic red, green, and yellow color codes.

Eric
[ June 01, 2008: Message edited by: Eric Pascarello ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rouven Withake:
Is it possible to do this with JSP ?

As has been pointed out, no.

JSP executes on the server in order to format the HTML page to send to the client. Once at the browser, client-side technologies such as JavaScript need to be used.

Perhaps this article will be helpful.
 
Rouven Withake
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your help

Rouven
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic