Results 1 to 5 of 5

Thread: Forms

  1. #1
    Registered
    Join Date
    May 2013
    Location
    Atlanta
    Posts
    1
    Rep Power
    0

    Forms

    I have taken over a website created in Site Deluxe. One section of the site has forms for user entry. The instructions on what to place in each line have been inserted as text in the form e.g. "Location: Enter your current work location". The form does not erase the instructions so unless the user erases the instructions manually the above comes out as "Location: Enter your current work location Atlanta". Can anyone suggest how I can make the new text overwrite the instructions as happens with most forms.

  2. #2
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,443
    Rep Power
    21
    This bit of code can be put in the input tag.
    onMouseOver="this.select()"
    This will select (suprise!) whatever text is already in the field, so anything typed will replace that already existing text.

    I haven't used Site Deluxe before, so I don't know how (or if) this code can be inserted where it is needed. You may need the ability to manually edit the pages source code.

    edit: look at the source code of this page - http://somdcomputerguy.com/gma/?p=contact to see where I've used that technique. I'm using it in the last field of the form (the one that's labeled 'access code')
    Last edited by snowmaker; 5-14-13 at 06:17 PM. Reason: edit:
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  3. #3
    Thinkin' out loud again Builder's Avatar
    Join Date
    Nov 2002
    Location
    Illinois
    Posts
    2,088
    Rep Power
    19
    HTML5 way to do it:

    HTML Code:
    Location: <input type="text" id="blah" name="blahblah" placeholder="Enter your current work location" />
    You might have to add a size="25" attribute (adjust number to fit) to allow all the text to appear in the entry area.

    Also see Bruce's comment
    You may need the ability to manually edit the pages source code.
    Good luck,
    Kevin
    A good friend will come and bail you out of jail...
    but a true friend will be sitting next to you saying,
    "Damn... that was fun!"

  4. #4
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,443
    Rep Power
    21
    Quote Originally Posted by Builder View Post
    HTML5 way to do it:

    HTML Code:
    Location: <input type="text" id="blah" name="blahblah" placeholder="Enter your current work location" />
    You might have to add a size="25" attribute (adjust number to fit) to allow all the text to appear in the entry area.

    Good luck,
    Kevin
    Hmm.. I'm going to look into this more tonight. I've been meaning to 'get more into' HTML5 anyway..
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  5. #5
    Thinkin' out loud again Builder's Avatar
    Join Date
    Nov 2002
    Location
    Illinois
    Posts
    2,088
    Rep Power
    19
    Some pretty cool stuff for forms in HTML5. For example, if you want someone's telephone number it would be <input type="tel" />. On mobile devices that automatically brings up the numbers keyboard. <input type="search" /> brings up the "Search" key on the onscreen keyboard. <input type="email" /> brings up the "@" and ".com" keys on the onscreen keyboard.

    Well, it does on iOS anyway.

    And of course you can combine attributes. So you can have <input type="search" placeholder="Enter search term here" />

    The cool thing is that if a browser doesn't recognize type="tel" e.g., it defaults to type="text" and the user is none-the-wiser.

    EDIT: one of the best is required="required". This brings up a neat "pointer-balloon" next to the "required" field if the user hasn't put anything in it. Not a substitute for validating e-mail fields, etc. via script, but it does make sure something is there.

    Kevin
    A good friend will come and bail you out of jail...
    but a true friend will be sitting next to you saying,
    "Damn... that was fun!"

Tags for this Thread

Posting Permissions

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