Results 1 to 4 of 4

Thread: Form Question
      
   

  1. #1
    albumin40's Avatar
    albumin40 is offline Sergeant Major
    Join Date
    Aug 2007
    Posts
    94

    Question Form Question

    Hi
    When building a form and adding a comments box I know it can be prepopulated with text.

    Is it possible when the user clicks on this text that it is all highlighted and thus the user can begin typing right away?

    I know that this is a very small point (probably nitpicking !) and that all the user has to do is simply delete the text.

    Can it be done?

    Thanks

    Colin (www.miscarriage-ni.org.uk)

  2. #2
    judavvforum is offline Major
    Join Date
    Nov 2007
    Location
    Arizona
    Posts
    389

    Default Re: Form Question

    Someone could probably do it with "scripts", but would cost you! Most computer users wouldn't expect that they could do that anyway. So, try this, (if the text doesn't matter to you): Type in this text: "Your comment box message,(Ctrl-click here to type)"They will point at the text at the end, hold Ctrl key and click. This will select all and delete the initial text when they start typing. At least it does in my XP/IE!

  3. #3
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form Question

    Try adding code inside the html of the textbox
    Code:
    onFocus="if(this.value=='Replace this with the exact default text that is shown in the text box')this.value='';"
    When you look at the html it should look something like this:
    Code:
    <textarea id="bv_" name="something" onFocus="if(this.value=='Your default text')this.value='';">Your default text</textarea>
    The red text in the code box above should match exactly

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  4. #4
    albumin40's Avatar
    albumin40 is offline Sergeant Major
    Join Date
    Aug 2007
    Posts
    94

    Default Re: Form Question

    Thanks guys. Very much appreciated !

    Sincerely

    Colin

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49