*
The moose likes HTML, CSS and JavaScript and the fly likes Removing the 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 "Removing the "null" test from textfields" Watch "Removing the "null" test from textfields" New topic
Author

Removing the "null" test from textfields

Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi,

I need some idea in this regard.

The Scenario :

I have a page, where I have to display some fields, which are brought from database.

Before the records are fetched, the textfields show "null". I can get rid of this using script.

I want to know whether, we can make a generalized script, which could be used to check all the textfields, in a page and then, set a value of "", when it is null?

Is there a way to get all the textfields in a script?

Cheers,
Swamy
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
This code may be what you are looking for:


You call it with:


There is one problem with this logic, if a person has JavaScript disabled, then the field values will still be set to the inital value since the code can not run.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing the "null" test from textfields
 
Similar Threads
Need Help in to write query using StringBuffer
How to add JLabel In a JTable cell
Enumeration Object problem
Tapestry-request loses parameters passed after page is rendered
Passing value to the applet