File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Textfield border disappears after validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Textfield border disappears after validation " Watch "Textfield border disappears after validation " New topic
Author

Textfield border disappears after validation

G Fior
Greenhorn

Joined: Aug 03, 2005
Posts: 2
I have a textfield with a border set to none to start with. It's the usual black border. When we validate the form for errors, if the user entered data that was incorrect, the textfield border is displayed in red. However, when the user corrects the data, clicks out the red disappears but the border is missing or not black again unless the page is reloaded. Anyone has any suggestions on how this can be fixed without reloading the page? We can reload the page or all the form will lose the input data. Thank you.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
how are you reseting the border back to normal?
Kuldeep Vaishnav
Ranch Hand

Joined: May 23, 2004
Posts: 72
I am not sure if this is on the target.But i am assuming that you are making the red border go away on entering the right entry somewhere in javascript.Can we not make the border black in the same code segment?

Discard if i am wrong or did not understand the situation correctly..just trying to throw some pointers here.
[ August 03, 2005: Message edited by: Kuldeep Vaishnav ]

Kuldeep
G Fior
Greenhorn

Joined: Aug 03, 2005
Posts: 2
Yes, I want to set it back to black the minute the user corrects the data in the box it should turn back to it's original state, ie black and thin. When I do an alert on the original border it gives me an empty string which it looks like the border used is NONE but then why does it show up on the form? Next, when I set my border to solid you see it. But how can I make it just thin as the original one? I tried to set the width to black 1 px and it doesn't seem to work. Any ideas? Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6


Example of changing the border color

Eric
 
jQuery in Action, 2nd edition
 
subject: Textfield border disappears after validation
 
Similar Threads
How to do a preview page for submitted form
howto return a value to a textField (on the jsp page)?-action invoked from javascript
Stop Textfield from Going Blank
Textfield with autoscroll feature!
Display the message in same page using submit button