• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Need some suggestion preventing user mouse click

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .

Regards,
Ayan
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ayan Dutta:
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.

I'd rethink this one. That would be very annoying. To the point where I'd just close the browser and go elsewhere.

It's fine to not be ale to submit the form until all input is correct. To not let them leave the field is just outright rude and annoying.
 
Ayan Dutta
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ayan Dutta
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea from anybody ?
Regards,
Ayan
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you looked into onblur with your validation? Have you looked into disabled? Have you looked at modifying an onclick to see if an action can take place?

Eric
 
What's that smell? I think this tiny ad may have stepped in something.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic