Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cursor not showing 1

Status
Not open for further replies.

ching0418

MIS
Mar 6, 2002
96
0
0
HK
I have an asp page with text boxes. I want my cursor to be shown highlighting the default value of the next field when the "tab" key is pressed, so that the user will just key-in the desired value instead of deleting the default values then key-in.

There should be no problem with this, but if i invoke a javascript on the field, the cursor is not shown. I tried removing the invoking code and i got what i want. But i can't remove this since I have to do something during onblur event. Is there a solution to this?

here's a sample of the textboxes:

Code:
<table width="354" border="0" align="center">
       <tr>
         <td width="223" class="style4">Bicycles</td>
         <td width="121" ><span class="style4">
           <input name="a1" type="text" class="style4" id="a1" value="<%=rsExp.Fields.Item("peex1").Value%>" size="15" onblur="compute_personnel()">
         </span></td>
       </tr>
       <tr>
         <td class="style4">Tools</td>
         <td ><span class="style4">
         <input name="a2" type="text" class="style4" id="a2" value="<%=rsExp.Fields.Item("peex2").Value%>" size="15" onblur="compute_personnel()">
</span></td>
       </tr>
       <tr>
         <td class="style4">Car Accessories </td>
         <td ><span class="style4">
           <input name="a3" type="text" class="style4" id="a3" value="<%=rsExp.Fields.Item("peex3").Value%>" size="15" onblur="compute_personnel()">
         </span></td>
       </tr>
       <tr>
         <td class="style4">Others</td>
         <td ><span class="style4">
           <input name="a4" type="text" class="style4" id="a4" value="<%=rsExp.Fields.Item("peex4").Value%>" size="15" onblur="compute_personnel()">
         </span></td>
       </tr>
       <tr bgcolor="#CCCCCC">
         <td class="style4">Total Personnel Expenses </td>
         <td ><span class="style4">
         <input name="at" type="text" class="style4" id="at" value="0.00" size="15" readonly>
</span></td>
       </tr>
       <tr>
         <td colspan="2" class="style4"><div align="center">
           <input name="save" type="button" class="style7" id="save" value="Save Draft" language="javascript" onClick="saved_click();">
           <input name="save" type="button" class="style7" id="save" value="Submit  for Approval" language="javascript" onClick="saveb_click();">             
           <input name="cancel" type="reset" class="style7" id="cancel" value="Cancel">
         </div></td>
         </tr>
     </table>

please help...thanks in advance
 
try putting this in your input fields:

onfocus="this.select();"

though it is normal behavior to not see a flashing cursor when the value is selected, if this is what you are expecting

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
thank you jemminger...that's what i need

i'll give you a star
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top