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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select field content on trigger not working with chrome

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I have this
Code:
<input id="width0" class="rfqmusthave" type="text" style="width: 85%;" maxlength="7" value="0.00" name="width[]" onblur="$(this).toNumber(); calcClass('0');" onkeyup="$(this).toNumber();" onclick="$(this).select();" onfocus="$(this).select();" onmouseup="return false">

if you click or tab into field with FireFox, IE or Edge it works - Chrome, in the other hand, selects in a flash and places cursor at end of field.

What can I do to get chrome to select and keep content selected?

Thank you all in advance for your help!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
I would recommend you stop using event attributes and use the jquery 'on' method to bind event handlers via an external JS file.

Also what does the error console show (F12), if anything?



"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Will research your suggestion and report back later!

--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top