• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Changing textfield bgcolour upon entering data  RSS feed

 
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
 
author & internet detective
Sheriff
Posts: 38569
659
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.
 
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 ]
 
Author and ninkuma
Marshal
Posts: 66806
168
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!