last day (14 days later) » 

12:55 PM
0
A: Multiple Form Validation in Asp.net MVC using Jquery.valid()

teo van kotYou have a problem with validatin hidden fields, jquery validation by default don't validate hidden fields, you can just change default: $.validator.setDefaults({ ignore: [] }); Buy also you can diasble tabs, that shouldn't be allowed here is example how to do it.

 
but in this case when i click on btnThree then it returns all form valid even they are not valid yet..
when whole div is hide then obviously it return true against validation.
 
now i get your problem, updated the answer with solution
 
and if some controls are decision based like if dropdown value is yes selected then show Age textbox.. Till then it should be hide by default.By your solution it goes to validate all fields.
 
yes, you right. then maby it's easier to disable tabs that user can't use by your logic?
Or use @Stephen approach.
 
Yes it may be option to disable tabs. Is it good for user experience.?
I am stuck on it seriously.....
yes i am here
is it possible to share my screen so that you completely understand the problem.
?
dear you there?
 
1:00 PM
YEap
use multistep wizard as Stephan say
I updated the answer
I think you really shouldn't use tabs here
 
actually i have a problem
 
we all have =)
 
in our whole project we approved accordion layout..
and client approved it my PM suggest him about that
 
hm... than disabling tabs is your option.
 
i have Model with 90 fields and these 90 fields are divided into 5 forms in the last form i merge all forms values and proceed with submition
 
1:04 PM
So?...
 
actually when someone press finish with out filling above forms then it return valid() true for all above 4 forms
 
you already know why =)
 
if i use your solution which i did before then it create new problem like decision based elements are also going to validate which are not even needed
haha yes
i know it
any magical way :p
 
when i was solving this kind of problem i just creating final state machine and after each form i submit values to server.
that's one of options.
the other opportunity is to use server side validation. Then you don't care about your client validation problem.
 
yes if i use server side validation for only Finish case
then is it good approach ?
 
1:09 PM
Not bad, i think in your situation.
still best will be wizard =)
 
and 1 thing i want to maintain my URL too like URL should be comes with hash sign
yes i know but i told you about my problem :/
this is the URL localhost:141/MyControler/Action/1#modify in the browser but when it goes to server side for validation i returned view with model but URL change to localhost:141/MyControler/Action/1
 
and what's the problem? you can easily do it.
here is example http://stackoverflow.com/a/2555005/1849444
wierd...
 
it is client side i am talking about server side
 
ah, you mean on POST form it changes?
 
exactly :)
you get my point when it post
 
1:15 PM
that's really not easy problem, blowser don't post it by default.
but here is a way how to solve it with js
 
yes
please tell and if i wrap hash on client side when response came from the server
 
i don't try it anyway... =) hope this helps.
 
hmm
i have my temp table with the state weather it is in modify mode or not. so if i change it here
there?
i irritate and take much of your time i know :) but you helped me too
Thanks for that
I am doing MVC that's why :D
 
i actually don't get you last question.
 
i said that on document.ready() i change the URL always
add hash with the URL when came from server side
i am talking about client side modification basically.
 
1:23 PM
yes i think you can change it there, why not? =)
 
ok :)
Thanks for your time.. You may ping me always if you have any problem regarding .Net :p
 
=) And there is a chat over here?
you can write me on skype
teo_van_kot - nick
 
no no on here dude my skype "malik_azhar_awan68" without quote
ok :)
 
i knocked
 

last day (14 days later) »