MadPotato Posted November 1, 2005 Share Posted November 1, 2005 first i want to appologise, since i could find my answer in a google search or something...but my lack of english skill simply keep me from finding the answers, so i decided to ask hereit's quite simple, i want to highlight (select) the text in a text box...actualy a noob question but i cant do it Link to comment Share on other sites More sharing options...
Chocolate570 Posted November 1, 2005 Share Posted November 1, 2005 In an input button, put this.<input type=button value="Highlight All" onClick="java script:this.form.txt.focus();this.form.txt.select();">where the name(or id?) or the textarea is 'txt'. Link to comment Share on other sites More sharing options...
Jonas Posted November 2, 2005 Share Posted November 2, 2005 I think it's name. When you use id you have to use the document.getElementById('your_id') function... Link to comment Share on other sites More sharing options...
MadPotato Posted November 3, 2005 Author Share Posted November 3, 2005 thanks 4 the helpand about name/id, i use both (name="txtBox" id="txtBox"), and getElementById()...in IE 6 if you got only 'name', getElementById() works as well, with an extra advantage of input the name/id by a string, what allow to call dinamicaly the objects(using a 'for' to get all text1, text2, text3...text10, for example) Link to comment Share on other sites More sharing options...
rao Posted November 3, 2005 Share Posted November 3, 2005 Your english is fine and you don't need to say 'sorry for bad english' Link to comment Share on other sites More sharing options...
MadPotato Posted November 3, 2005 Author Share Posted November 3, 2005 Link to comment Share on other sites More sharing options...
Jack McKalling Posted November 6, 2005 Share Posted November 6, 2005 Do you still have questions about selecting text in some input/textarea fields?Or do you want to select only part of the elements content ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now