Selecting a text Field

Selecting a text Field

Hi All,

I validate a field on 'user input'. When i am using the keyboard to fill the form, on pressing the tab from the text field "executes the validation script". At this point, my cursor moves to the next field. This is fine when the validation is fine.

If the validation fails, i want the cursor to stay back in that particular field, with the text selected.

How do i do this?

Thanks in advance.

Regards
Jos Raj Martin