Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text in a Text Input Box

Status
Not open for further replies.

debbie1212

Programmer
May 31, 2000
66
US
I would like to have " already appear in the text box when users enter a URL and the cursor be placed after the last "/". Otherwise some people put in the http:// and some don't and then the links don't work correctly. I could put a note to include it but I would prefer that it already be there since people don't always read the comments for inputing fields.
 
hi debbie,

all you need to do is put VALUE=&quot; inside your <INPUT> tag, like this...

<INPUT TYPE=&quot;text&quot; VALUE=&quot;
i'm not sure where the cursor would be though.

nb. don't include the ';' - this forum seems to be adding it in!

ss
 
Hiya, this is a simple way to accomplish what you need. Just be sure to add this somewhere to the end of your code (like down toward the </body> tag so that it will execute after the form has been created and everything else is done.)

<script language=vbscript>
test.Text.focus
test.Text.value=&quot;</script>

Tazzmann
 
It's easy to have the &quot; already appear in a text box, but not so easy to have the cursor automatically positioned at the end. However, it's not hard for the user to click in the box and make the cursor go the the end. To put the text in just do this:
Code:
<input type=&quot;text&quot; name=&quot;url&quot; value=&quot;[URL unfurl="true"]http://&quot;>[/URL]
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks to everyone for your responses. I knew it couldn't be difficult. It's just finding the right resources. And this site is definitely a great one!

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top