A have to develop a page where there are few tabs, say tab1 ,tab2 and tab3 .Clicking on tab1 a page appears. In this page there are some input fields (say X,Y,Z )and many buttons like edit,delete ,save .
Now requirement is if the user enters a wrong data in the field X,then
1.he should not able to move out from X . That is he should not able to navigate/move to Y,Z and enter anything. 2.he should not able to click any of the buttons (edit,delete,save ) 3.he should not able to click any of tabs(tab2 and tab3).
I have a method which validate X,Y ,Z . say this method name is validateFieldInput() it gets invoked on the onblur of X. What I think is that If validateFieldInput() can have the ability to disable mouse click when the data is wrong and enable the mouse click when correct data is entered , the situation 1,2,3 is handled at a single go .
What you people suggest ? Is that possible ?
If that is possible please help me how this can be done . Even if there are other better ideas please suggest . But is my approach is possible or not I want to know .
On page load you could disable all the elements the user cannot access. Then, you could validate X as the user enters data (using onkeydown, onkeyup perhaps). if the user input in X becomes valid at any point, enable Y...follow the same process for each input until the user completes Z, then enable your buttons or tabs or whatnot.
sounds like a lot of work in any event. can't you just verify the entire form in one go rather than one element at a time?
Yes I agree that it is in fact annoying, but that is how the requirement is at the business level .If I have a system which I can develop in my own way ,then no way I am going allow these sort of restrictions.But unfortunately the requirement is like that . Any generic idea / solutions keeping the requirements in mind ? Regards, Ayan