-
Reset the value of a textbox
Hi,
I call a function with the onblur and as parameter passing a certain value, like this:
onblur="CheckNum(this.value)"
When it appears that within the function the value is wrong I want to set the value to "0", but I have about 100 textboxes in which it can be wrong. How do I manage that ?
Code of the function is e.g. as follows:
function CheckNum(value1)
{
if (value>=1 && value<=8)
{
return true
}
else
{
return false
AND NOW the value of the calling textbox should be "0"
}
}
Help is appreciated, rgds Ger.
-
Strictly speaking this is a java forum, not javascript....
But I think you should call the CheckNum function with the textfield as parameter,
not its value, like;
onblur="CheckNum(this)"
Then you don't have to worry about which field it is.
eschew obfuscation
-
Hey Sjalle,
I didnot realise this is JAVA and not JAVASCRIPT, so I won't create a new thread here !
Anyway... thanks for your help,
regards from Holland, Ger.
Similar Threads
-
By Miles Tones in forum VB Classic
Replies: 2
Last Post: 06-30-2005, 12:57 PM
-
By hoyaabanks in forum ASP.NET
Replies: 2
Last Post: 06-09-2005, 12:35 PM
-
By David Chu in forum .NET
Replies: 1
Last Post: 01-09-2003, 05:50 PM
-
Replies: 0
Last Post: 03-12-2002, 02:55 PM
-
By Marat Musaev in forum XML
Replies: 0
Last Post: 11-02-2000, 08:54 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks