Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with client side validators and state

Reply
Thread Tools

Problem with client side validators and state

 
 
just.an.imbecile
Guest
Posts: n/a
 
      06-21-2006
Hello all,
Here is a quick version of my problem. I have a website that
consists of 4 ASPX pages. Every field is required by default, but on
pages 1 and 2, there are several fields that can be disabled based on
answers to questions. (Ex. If they have been at their current address
for over two years, then they are not required to fill out the previous
address information). It all works great, except that when I go back to
page 1 from page 2, I have to re-answer the questions that disable
validation all over again. (Ex. I say I have been at my current address
for 5 years and click next to go to page 2. Then I click previous to go
back to page 1. I am forced to answer the question again because
previous address has become required again).

I have determined that my server side code to conditionally turn off
validators works perfectly. The problem is in my client side javascript
code.

I tried adding calls to the javascript code that turns off
validators every time that someone clicks next and previous. This
worked fine, except that none of the rest of the validators worked
untill the user either filled out the conditionally required fields, or
answered the condition questions to make them all not required. (Ex. If
I asked for their name and current and previous address info, it would
tell me that the previous address info is required, but not their name
or current address. Then, if I filled out the previous address, or said
I had been at my current address over 2 years, it would finally tell me
that current address and their name are required).

Sorry if this is long, but I hope it is at least clear. Does anyone
have any ideas as to how to either:
a) Validate everything and still call my javascript to check the
conditional required statements

or

b) Persist the Client Side status of the validators from page to
page?

Please let me know if anything needs clarification, and thanks in
advance for any help.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client-Side Validation with Validators and JavaScript Nathan Sokalski ASP .Net Building Controls 4 02-11-2008 07:58 PM
Client-Side Validation with Validators and JavaScript Nathan Sokalski ASP .Net 4 02-11-2008 07:58 PM
Server-side events do not fire the first time after client-side validators have fired Stuart Whiteford ASP .Net 2 04-25-2006 10:10 AM
Validators and client side script Mike Surcouf ASP .Net 3 01-27-2006 04:45 PM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM



Advertisments