Problem with client side validators and state

J

just.an.imbecile

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top