thomas908
asked on
Cursor in Text field
I have some form fields like
<!-- FirstName Field //-->
<div class="formfield_row">
<div class="formfield_label"> <%= firstNameLabel %> <span class="required">*</span>< /div>
<div class = "formfield_input">
<input class="formfield"
type="text"
name="usr_firstname"
value="<%= firstName%>"
onfocus="if(this.value=='< %= usrFirstNameDefault %>')this.value = ''"
onblur="if(this.value=='') this.value ='<%= usrFirstNameDefault %>';"
maxLength="30"/>
</div>
</div>
<!-- LastName Field //-->
<div class = "formfield_row">
<div class = "formfield_label"><%= lastNameLabel %> <span class="required">*</span>< /div>
<div class = "formfield_input">
<input class="formfield"
type = "text"
name = "usr_lastname"
value = "<%= lastName%>"
onfocus="if(this.value=='< %= usrLastNameDefault %>')this.value = ''"
onblur="if(this.value=='') this.value ='<%= usrLastNameDefault %>';"
maxLength = "30"/>
</div>
</div>
<!-- CompanyName Field //-->
<div class = "formfield_row">
<div class = "formfield_label"><%= compNameLabel %></div>
<div class = "formfield_input">
<input class="formfield"
type = "text"
name = "usr_comp_name"
value = "<%= compName%>"
onfocus="if(this.value=='< %= usrCompNameDefault %>')this.value = ''"
onblur="if(this.value=='') this.value ='<%= usrCompNameDefault %>';"
maxLength = "30"/>
</div>
</div>
The problem is that when the user navigates from one field to another using "Tab", a blinking cursor is not placed in that field. Is there any way to enforce it?
When the user clicks on the field using a mouse then its working fine.
Thanks
<!-- FirstName Field //-->
<div class="formfield_row">
<div class="formfield_label"> <%= firstNameLabel %> <span class="required">*</span><
<div class = "formfield_input">
<input class="formfield"
type="text"
name="usr_firstname"
value="<%= firstName%>"
onfocus="if(this.value=='<
onblur="if(this.value=='')
maxLength="30"/>
</div>
</div>
<!-- LastName Field //-->
<div class = "formfield_row">
<div class = "formfield_label"><%= lastNameLabel %> <span class="required">*</span><
<div class = "formfield_input">
<input class="formfield"
type = "text"
name = "usr_lastname"
value = "<%= lastName%>"
onfocus="if(this.value=='<
onblur="if(this.value=='')
maxLength = "30"/>
</div>
</div>
<!-- CompanyName Field //-->
<div class = "formfield_row">
<div class = "formfield_label"><%= compNameLabel %></div>
<div class = "formfield_input">
<input class="formfield"
type = "text"
name = "usr_comp_name"
value = "<%= compName%>"
onfocus="if(this.value=='<
onblur="if(this.value=='')
maxLength = "30"/>
</div>
</div>
The problem is that when the user navigates from one field to another using "Tab", a blinking cursor is not placed in that field. Is there any way to enforce it?
When the user clicks on the field using a mouse then its working fine.
Thanks
ASKER
It's IE on windows.
ASKER
The contents in the field get erased as soon as the focus comes on that field. But the problem is that the curson is not displayed. There is no big blue highlight in this case. Also If I click on the field using mouse the cursor appears. I want it to appear when tab navigating.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot. That works perfect
If I tab in IE win, there is a big blue highlight - not a blinking cursor. That is normal behaviour and something I as a user REALLY prefer
If you want the blinking cursor, you need an empty field