p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 30th, 2004, 03:32 AM
Authorized User
Points: 152, Level: 3
Points: 152, Level: 3 Points: 152, Level: 3 Points: 152, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old April 30th, 2004, 12:28 PM
Friend of Wrox
Points: 2,801, Level: 22
Points: 2,801, Level: 22 Points: 2,801, Level: 22 Points: 2,801, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

<><
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old April 30th, 2004, 03:09 PM
Friend of Wrox
Points: 4,754, Level: 29
Points: 4,754, Level: 29 Points: 4,754, Level: 29 Points: 4,754, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old April 30th, 2004, 10:07 PM
Friend of Wrox
Points: 7,647, Level: 37
Points: 7,647, Level: 37 Points: 7,647, Level: 37 Points: 7,647, Level: 37
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,477
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternative to BOOKMARKS Shiamak Word VBA 2 October 31st, 2008 05:04 PM
quick one: onblur - text box highlight retroviz BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 6th, 2008 05:18 PM
calling a codebehind function on onblur event vishnupriya.kamalakaram ASP.NET 1.0 and 1.1 Basics 2 July 7th, 2006 09:25 AM
How to call a codebehin function on onblur event?? kv Priya ASP.NET 1.0 and 1.1 Professional 1 June 14th, 2006 03:43 PM
tabindexes don't work with onBlur function in Net elisabeth Javascript 14 November 24th, 2004 11:07 AM



All times are GMT -4. The time now is 03:19 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc