|
|
Select All Text In A Form Field On Click | ||
Discussion by Amezis with 4 Replies.
Last Update: May 6, 2010, 1:13 am | |||
![]() |
|
|
CODE
<input type="text" name="bbcode" size="81" value="[IMG]<?php echo $url; ?>[/IMG]">Well, anyway, I want something that selects all the text in that form field when you click on it, like it does in ImageShack when you upload...
Set up a function in between the <head> </head> tags of your page like this.
CODE
<script language="JavaScript">function highlight(field) {
field.focus();
field.select();
}</script>
And then for each field that you want to select all the text in when clicked, add this 'onClick' action.
CODE
<input type="text" name="bbcode" size="81" value="[IMG]<?php echo $url; ?>[/IMG]" onClick='highlight(this);'>Hope that helps.
Hello,
I tried following the instructions you provided to create a textarea with one-click-select-all behavior in a wordpress article. I had to include the
function highlight(field) { field.Focus(); field.Select();}
in an external file. When trying to use the highlight(), nothing happens. Any update to this script?
-reply by gnucom
function highlight(field) { field.Focus(); field.Select();}
javascript is case sensitive...
Should
field.Focus(); Field.Select();
you could just add to onclick this.Select()
-reply by philt
http://www.tutorials99.com
Similar Topics:
Onclick Image gt gt Add Text To...
Preventing A Form To Submit If A Fi...
Text Size In quot fill in quot Fo...
Making A Refresh Link On Your Website. refresh local webpage (18)
|
(12) Fixed Background Image Just little reminder
|
Loading...
HOME 





Using Field Collection In Drupal 7
Access 2010: Highlight data on forms by using conditional formatting.wmv
How To Scan To PDF, Print To PDF, Fill Out Forms & Electronically Publish PDF's

