#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    322
    Rep Power
    16

    spaces within the select value tag


    Can a html form have spaces within the value clause in a select statement?

    For example:

    <option value=\"132slotcars\">132 slot cars</option>

    is fine and works

    but would

    <option value=\"132 slot cars\">132 slot cars</option>

    work?

    The reason I ask, is I am going to grab the values from a database, and I need to know, one way or another, if I need to script to remove spaces from a user input, or if I can leave the field alone and insert like normal.


    Thanks for your help!
  2. #2
  3. I have a red lunch bag
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jan 2005
    Location
    The armpit of Niagara
    Posts
    3,115
    Rep Power
    344
    This might be an old fasioned idea, but you could always try it. Y'know, like drop it in an html file and see how it shows up.

    But yes, it should work fine.
    Web Design Tips - Posting and You

    If I've been helpful, and/or you're really nice, consider buying something from my Amazon.com wishlist.
    • There is no room for pride when trying to be the best at what you do.
    • Friends don't let friends use bad code.
    The club is dead.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    322
    Rep Power
    16
    yeah.... Didn't think about it that way. I was coding something else, and didn't really think about it.

    Thanks though!
  6. #4
  7. Professional Lay-A-Bout
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Location
    Ann Arbor, Michigan
    Posts
    302
    Rep Power
    16
    Originally Posted by Gnome101
    yeah.... Didn't think about it that way. I was coding something else, and didn't really think about it.

    Thanks though!
    It should work but it may cause some select browsers to hiccup when it's run into.
    Thomas

    Dogs and computers both do everything you tell them.
    But computers don't like their tummies rubbed.
  8. #5
  9. At night, the ice weasels come
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2005
    Posts
    1,046
    Rep Power
    63
    Originally Posted by trumley
    It should work but it may cause some select browsers to hiccup when it's run into.
    I can't imagine why that would be with anything resembling a modern browser. If a value is within quotes the spaces it contains shouldn't make any difference at all.

    Comments on this post

    • Kravvitz agrees
    • trumley agrees : yup older browsers

IMN logo majestic logo threadwatch logo seochat tools logo