www.webdeveloper.com
Results 1 to 4 of 4

Thread: Problem getting inch and feet characters from form values

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Posts
    3

    Problem getting inch and feet characters from form values

    I'm creating a form where basketball coaches can enter their teams roster and then that gets sent to a database which then appears on the rosters page of the site.

    My problem is where they select the players height. I don't want them to enter it as text manually as I want this to be consistent across all rosters, example: 6' 3"

    So I decided to give them a drop down menu to select the height. I go from 4' 0" all the way up to 7' 3".

    But I'm pretty sure I can't use this:

    <select name="height" >
    <option value="4' 8"">4' 8"</option>

    Not sure how to get the foot character and inch character to appear correctly in the results.

    Thanks for any help
    Steve

  2. #2
    Join Date
    Nov 2012
    Posts
    4
    Inches will be: &#34;
    Feet will be: &#39,
    Hope this helps! Best to you!

  3. #3
    Join Date
    Mar 2011
    Posts
    1,156
    You need to escape (encode) the quotation mark in the <option> tag so that the browser knows that you mean to include it in the value and not the end of it. Just precede the quotation mark with a backslash, as in:
    Code:
    <option value="4' 8\"">4' 8"</option>

  4. #4
    Join Date
    Sep 2010
    Posts
    3
    Thanks very much guys, got it to work!

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
  •  
HTML5 Development Center



Recent Articles