Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

client side validation trouble

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DaveyP - 29 Apr 2008 11:27 GMT
Ok.

I have a page with a textbox which is used to enter numeric data. If
data is entered, the code goes to the database and gets the relevant
data. If it's left blank, the code assumes that new data is being
entered and allocates a number.

The problem is that the client side validation (custom validator with
Jscript to check for numeric input) on the text box is firing twice.

Any ideas?

Ta.
DaveyP - 29 Apr 2008 15:16 GMT
Ok, sort of figured it.

The textbox has autopostback = true, cos it needs to get the relevant
data (if not invalid). Unless I'm wring (which in reality is most
likely), it's running the code once for the "lost focus" and once for
the postback.

If I'm right, how do I stop one of them?

> Ok.
>
[quoted text clipped - 9 lines]
>
> Ta.
bruce barker - 29 Apr 2008 17:12 GMT
you can't, it by design. the validation is called on lost focus, and on a
validated submit. your validation shoudl support running mutilple times.

-- bruce (sqlwork.com)

> Ok, sort of figured it.
>
[quoted text clipped - 18 lines]
> >
> > Ta.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.