Forum Moderators: open

Message Too Old, No Replies

Can not set focus for this field

         

ksvijay

5:46 am on Jun 17, 2005 (gmt 0)

10+ Year Member



I have a 6 text boxes;

<form name="one">
<input type="text" name="text1" size="20"><br>
<input type="text" name="text2" size="20"><br>
<input type="text" name="text3" size="20"><br>
<input type="text" name="text4" size="20"><br>

and next there is one icon, if i click that icon
the other 2 text fields are shown.

<input type="text" name="text5" size="20"><br>
<input type="text" name="text6" size="20"><br>

if i close that icon tis 2 text fields are hidden
<input type="Submit" onclick="callme()">

I am validating that all fields are should be integer only,

and any one contain non integer field the focus should be set for that field,

The problem is while i was setting the focus for the hidden field "Focus cannot be set for the filed as it is hidden'
Error coming How can i resolve this one.

Sathallrin

12:25 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



When you are doing your field validation, first do a check to see if the fields are hidden. If they are hidden, do not check them or submit them.

If you have to check if they are valid, even when hidden. You could either make them visible before setting focus, or check if they are hidden and set no focus if they don't validate.