Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Removing the "null" test from textfields  RSS feed

 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!