Groups > Asp .Net > ASP.NET Atlas Framework discussion > Re: JavaScript Validation




JavaScript Validation

JavaScript Validation
Tue, 26 Sep 2006 20:20:03 +000
HI, i was wondering if you guys could help me out, i am stuck.

 I have a web form with a 3 textfields that perform a search and a datagrid is
populated, which the search results. The datgrid is within an update panel and
everything works fine in terms of the Ajax Async postback. What i wanted to do
i(client side) is to provide some simple form validation, to check the data
entered etc before doing the async postback, how would i do this? I have tried
looking everywhere for this.

 

thanks

Joe
Post Reply
Re: JavaScript Validation
Wed, 27 Sep 2006 10:10:49 +000
hello.

well, since you're using updatepanels, i think that you should use asp.net
validators. atlas has several validators, but in my opinion, they're limited
when compared with teh asp.net validators.
Post Reply
Re: JavaScript Validation
Wed, 27 Sep 2006 10:29:56 +000
Can i work around this without using a validator i mean i am quite old fashioned
and i would like to just call my JavaScript validation function before doing the
async postback. Can you show me a simple example of how i would do this, i mean
at the moment i have a onCLientClick ( that calls that Jsvascript validation
function) and i have a onClick that called the server function. If the
validation returns false then the postback still happens i dont want it to. 

 p.s. All validation needs to be done client side, i belive validators work
server side?

many thanks 

Joe
Post Reply
Re: JavaScript Validation
Wed, 27 Sep 2006 10:35:13 +000
hello.

try this:

1.handle the propertychanged of the pagerequestmanager (search this forum for
examples on how to do that)

2. if the data isn't valid, call the abortPostBak method of the
pagerequestmanager (it should abort the postback though i really don't know of
this will do what you want)
Post Reply
Re: JavaScript Validation
Wed, 27 Sep 2006 10:40:04 +000
thanks maderia, i will try that, its suprising that there is not a simple way of
cancelling the postback if the form fields are invalid.

 

joe
Post Reply
<< Previous 1 2 3 Next >>
( Page 1 of 3 )
about | contact