View Single Post
Old 10-12-2007, 12:34 PM   #1 (permalink)
krates
Be CoOl rAp RuLeZ !!!
 
krates's Avatar
 
Join Date: Feb 2007
Posts: 1,968
Wink Creating a button to select everything in a text area.

Here is a simple script sometimes you want to highlight verything in a text field so that the user can copy it or something.
script goes here


<form>
<center>
<input type=button value=”Highlight All” onClick=”javascript:this.form.textarea.focus();thi s.form.textarea.select();”>

<br>
<textarea NAME=”textarea” ROWS=10 COLS=30 WRAP=VIRTUAL>
Put all the content over here.
Thanks kushagra
</textarea>
</center>
</form>




just notice one the textarea name is textarea and
javascript:this.form.textarea.focus();this.form.te xtarea.select();

Change every textarea word with the name of your text area

and for a google type by just clicking on textarea everything gets selected you can do

<form>
<center>


<textarea NAME="textarea" ROWS=10 COLS=30 WRAP=VIRTUAL onClick="javascript:this.form.textarea.focus();thi s.form.textarea.select();">

Put all the content over here.

Thanks kushagra
</textarea>
</center>
</form>


http://www.easytutorial.info/?p=22

please double check for the whitespaces by mistakes


thanks
krates
__________________
iPhone 3G 16GB + Samsung I450 + Sennheiser CXL 400 + PSP Phat + Samsung NC10 :D

Previous phones: N73ME , W810I , Asus P320

Last edited by krates; 10-12-2007 at 12:41 PM.
krates is offline