GeeCON Prague 2014*
The moose likes HTML, CSS and JavaScript and the fly likes Check box (if checks)  validation on text field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Check box (if checks)  validation on text field" Watch "Check box (if checks)  validation on text field" New topic
Author

Check box (if checks) validation on text field

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Hi,
In our page we have one check box and corresponding two text fields in a row. and many rows in a table.

if the user checked the box, then automatically the cursor should go to corresponding text field and do validation on that text field and i need to apply onblur event on that text field that we dont give the permission to move out from that filed until user fills correct value.

I can able to validate field with onblur and showing message field is required. but when I click on the check box the cursor is not moving to that field. how would I go directly to that field.

here is the following code.



Please suggest me on this, i want to go directly to the quantity field.

One more question: the above validation what I did is working under IE


Thanks,
Kumar
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
One more question: the above validation what I did is working under IE but its not working properly in Mozilla, why? but I need to be validate the fields in any of the browser.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Originally posted by sumant kuchipudi:
but its not working properly in Mozilla, why?

I assume you mean Firefox? What did Firebug show you?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Firebox is not showing anything, its just allowing to move out from the text box. where as in IE its not allowing to move out from that filed until fill correct value, the onblur event is working.


what about the above suggestion? how can I move directly to the text field if I click on the checkbox?
 
GeeCON Prague 2014
 
subject: Check box (if checks) validation on text field