Link to home
Start Free TrialLog in
Avatar of thomas908
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">
           &nbsp;<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">
               &nbsp;<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">
            &nbsp;<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
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

In what browser on what platform?

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
Avatar of thomas908
thomas908

ASKER

It's IE on windows.
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
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a lot. That works perfect