|
|
 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

April 30th, 2004, 03:32 AM
|
|
Authorized User
|
|
Join Date: Jan 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Alternative to onBlur() event
I am using onblur() event in an ASP page to validate the data entered in a textbox. Data should not be aphanumeric. It should be only numeric. The code is working fine:
<td><input type="text" id=txtPSTelExtn name=txtPSTelExtn size = 4 maxlength = 4 onBlur="validateEntry(window.document.frmOfficer.t xtPSTelExtn)" value =<%=PSTelExtn%> ></td>
But i want to know if there is any alternative to using onblur event. I dont want to use it. I guess it gives problems sometimes.
Thanks
Ashu
|

April 30th, 2004, 12:28 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You will probably get more answers in the HTML Code Clinic or JavaScript How-To forums, as this has almost nothing to do with ASP. You are only giving the textbox a value with ASP.
Besides, what kind of problems do you experience using onBlur?
HTH,
Snib
<><
|

April 30th, 2004, 03:09 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hello,
Your other option is to validate it when the form is submitted. You can use javascript at the form level to validate elements when the form is being submitted. Other than that, I know javascript has onblur and onfocus events for retrieve/lost focus.
Brian
|

April 30th, 2004, 10:07 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,477
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I dont think there is an alternate to this.
1) You can use write a Javascript function and validate it at client-side once the value is entered and focus is off from this conrol otherwise onclick of SUBMIT button validate all the FORM controls using an user-defined javascript function and return sussess/failure on validation and submit the form based on the reult returned.
2) You can submit the values from the form and validate it using ASP functions at the server-side.
AFAIK, there is no other possibility.
I would STRONGLY suggest doing both client-side and server-side validation as a good practice, as considering the cross-browser-compatibility, some functionalities may work in some browser and some may not. But you got to take pain in coding for both the types of validation for the better working of you app.
Hope that Helps.
Cheers!
-Vijay G
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |