javascript - How not to display Cursor in a read only input type text box in Mozilla Firefox -


i'm using mozlla firefox vesrion 24.01.

i've text box input field in form whics read only. in mozilla, see cursor blinking inside textbox when pointing text box, in chrome, not.

is there way not have cursor shown in mozilla also?

i've searched lot, , have seen answers regarding put

onfocus="this.blur();"

as inline inside input field. but, works in html. when tried rails text_field_tag not taking method 'onfocus'. so, either please suggest me better solution hide cursor or tell me how can achieve text_field_tag , onfocus event.

thanks :)

suggestion cbroe worked. but, in rails way,

<%= text_field_tag "answer_name",truncate(answer.name,:length=>35), :onfocus => "this.blur();", :style=>"cursor:default;", :readonly => true%> 

it worked. don't forget put css line 'cursor: default;' change pointer arrow type default, text box have text-mode pointer (the pointer type can see while putting answer in through area).

this won't work in ie. so, better replace text_field div element , make text_field hidden field carry out opeartions.

thank all. :)


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -