help with non text box

Discussion in 'HTML & Website Design' started by Dirty-Rockstar, Feb 15, 2007.

  1. #1
    The below html give you a white bar. and you can type things in it. :) i need help figuring out the html for this where i get the same box but a user cannot type in the box. the box will be used to show data. im assuming i change the imput type or method. I stole this from a previous thing i made. help?
    
    <form method='post' action=test.php>
    <input type='text' name='name' value='value' maxlength='X'>
    </form>
    
    Code (markup):

     
    Dirty-Rockstar, Feb 15, 2007 IP
  2. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #2
    That's easy, see below:
    <form method='post' action=test.php>
    <input type='text' name='name' value='value' maxlength='X' readonly />
    </form>
    Code (markup):
     
    Clive, Feb 16, 2007 IP
  3. Dirty-Rockstar

    Dirty-Rockstar Guest

    Messages:
    252
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you very much. works perfect. im new to tagging and coding. worked perfect
     
    Dirty-Rockstar, Feb 16, 2007 IP
  4. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #4
    Hey, welcome to DP :)
    I'm sure you'll get to learn things while being here.
     
    Clive, Feb 16, 2007 IP
  5. CBDealer

    CBDealer Guest

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    A quick pointer for broader compatiblity with newer standards-
    Attribute values should be enclosed in double quotes as opposed to single, and they should always be specified. So your code would look like:
    <form method="post" action="test.php">
    <input type="text" name="name" value="value" maxlength="X" readonly="readonly" />
    </form>
    HTML:
     
    CBDealer, Feb 16, 2007 IP