Jump to content

Form Validation - Focus property????


skaterdav85

Recommended Posts

So im creating a form, and I have JS validation where it checks the textbox to see if it is empty or not. I want the focus to remain on the form object if the form object is left blank. Is there some kind of focus property for the form to do this in JS? or any other way i can look into in JS? Thanks!

Link to comment
Share on other sites

I would look into the onblur and onfocus properties. You can write functions that are triggered with those events that could check the value and reset focus if necessary.-Jason
ya i have the onblur event, but even when my alert comes up saying "Dont leave the field empty", it still moves to the next field. How do i reset the focus?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...