|
|
|
|
![]() ![]() |
Oct 3 2005, 10:51 AM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 535 Joined: 14-February 05 From: Oslo, Norway Member No.: 3,759 |
Hi, I have made a script which generates a BBcode when you run it, and displays it in a text field, like this:
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... |
|
|
|
Oct 3 2005, 12:26 PM
Post
#2
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 630 Joined: 12-August 05 From: Melbourne, Australia Member No.: 10,624 |
Looking at the Imageshack site, this is the way you could do it for your site.
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. |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 11th October 2008 - 11:54 PM |