textarea, making the field longer.

Discussion in 'HTML & Website Design' started by Matt Ridge, Sep 14, 2011.

  1. #1
    Below is a code I'm working on, bare with how it looks... one field needs to be longer, but when I look at it in code form it looks like it should work, but when I test it out on a browser the fields don't change.

    The attachment is the css and the HTML for the page.

    If someone can solve this it would be greatly appreciated.

    View attachment 59539

    <div class="NCMR">
    <table>
    <tr>
    <td id="noncon"><textarea name="suppliernumber" rows="3">Nonconformity (Be Specific):</textarea></td>
    </tr>
    <tr>
    <td id="Dispo"><textarea name="suppliernumber" rows="3">Disposition (Initiatior):</textarea></td>
    </tr>
    <tr>
    <td id="comments"><textarea name="suppliernumber" rows="3" cols="30">Comments:</textarea></td>
    </tr>
    <tr>
    <td id="addcomments"><textarea name="suppliernumber" rows="3">Comments/Additional Detail:</textarea></td>
    </tr>
    </div>
    
    Code (markup):

     

    Attached Files:

    Solved! View solution.
    Last edited: Sep 14, 2011
    Matt Ridge, Sep 14, 2011 IP
  2. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #2
    I edited the files to be more readable... I hope this helps solving the issue I have. So far I still can't find out why this is not working.
     
    Matt Ridge, Sep 14, 2011 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    Which field? Higher or wider?
     
    Rukbat, Sep 14, 2011 IP
  4. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Wider, higher isn't a problem.
     
    Matt Ridge, Sep 14, 2011 IP
  5. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #5
    cols="" <==== Adding Columns will increase the base width of the textarea...

    
    <textarea rows="10" cols="20">
    
    Code (markup):
     
    workingsmart, Sep 14, 2011 IP
  6. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    Already did that, it's not working...as shown in the original post...


    <td id="comments"><textarea name="suppliernumber" rows="3" cols="30">Comments:</textarea></td>
     
    Matt Ridge, Sep 14, 2011 IP
  7. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #7
    Originally posted code doesn't show cols in all textareas so I missed the one in comments.. ==>

    
    
    <div class="NCMR">
    <table>
    <tr>
    <td id="noncon"><textarea name="suppliernumber" rows="3">Nonconformity (Be Specific):</textarea></td>
    </tr>
    <tr>
    <td id="Dispo"><textarea name="suppliernumber" rows="3">Disposition (Initiatior):</textarea></td>
    </tr>
    <tr>
    <td id="comments"><textarea name="suppliernumber" rows="3" cols="30">Comments:</textarea></td>
    </tr>
    <tr>
    <td id="addcomments"><textarea name="suppliernumber" rows="3">Comments/Additional Detail:</textarea></td>
    </tr>
    </table>
    </div>
    
    Code (markup):

    You could assign a width to the textarea in your css as well....

    
    #comments textarea { width: 500px; }
    
    Code (markup):
     
    Last edited: Sep 14, 2011
    workingsmart, Sep 14, 2011 IP
  8. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #8
    Since you're using tables for layout (which has been a no-no for years), the textarea can't get any wider than the container it's in (the <td>). Make the container wider. Or get rid of the tables and use CSS for layout.
     
    Rukbat, Sep 14, 2011 IP
  9. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #9
    Ok, just curious since I am new to using XHTML and CSS together (well new enough) why is it bad to use table for layouts? In place of tables how do you suggest to keep organization of things such as .MatOrg without using frames?

    Yes I know you can use CSS, but the last thing I really need is a massive CSS sheet that would make someone cry attempting to figure out where to change something without blowing up the entire site by accident.
     
    Matt Ridge, Sep 15, 2011 IP
  10. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #10
    Only problem is I need one field larger than the others... so you see my quandary... I would like to use a CSS script for it, but how do I put an ID in a textarea field?
     
    Matt Ridge, Sep 15, 2011 IP
  11. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #11
    <input type="textarea" id="myId" ... />
     
    Rukbat, Sep 15, 2011 IP
  12. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #12
    Thanks, wasn't sure if it needed like id Class="x"...
     
    Matt Ridge, Sep 15, 2011 IP
  13. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #13
    But you have the <td id="comments"> therefore the #comments textarea <= is a child of #comments and inherits the value without the need to assign an id to the textarea.

    as stated above, you shouldn't be using tables for layout purposes. Tables are for "tabular" data.

    You should be controlling the <form> with css and using to control textarea's by id or input[type=""], and so on... minimize your markup and allow CSS to do the work for you.
     
    workingsmart, Sep 15, 2011 IP
  14. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #14
    OK, went a step further and did a little tinkering, I can now get the width fine, now I need to have it so that a field can be taller...which I have figured out, but it seems that Chrome in this case allows the textfield to be increased or decreased manually, is there a way to make is so that the end user can't?
     
    Matt Ridge, Sep 15, 2011 IP
  15. #15
    In your CSS file...

    
    textarea { resize: none; }
    
    Code (markup):
     
    workingsmart, Sep 15, 2011 IP
  16. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #16
    Sweet, thanks very much.
     
    Matt Ridge, Sep 15, 2011 IP
  17. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #17
    Class and ID are 2 different things. You can have only one element of a given ID, you can have many elements of the same class. For instance, if you want the background of all your text inputs to be blue, give text and textarea elements a class of "blue" (class="blue"). Then style .blue in your CSS (.selectors are classes, #selectors are ids) with the color background you want.

    If you give 2 elements the same ID, you'll have problems. What problems? Different ones in different browsers, but the kind that cause web designers to be bald by the age of 25. If you don't realize that you've done it, there's no way to figure out why IE works, Firefox kind of works and Opera does weird things.
     
    Rukbat, Sep 15, 2011 IP
  18. workingsmart

    workingsmart Well-Known Member

    Messages:
    411
    Likes Received:
    12
    Best Answers:
    9
    Trophy Points:
    120
    #18
    Just to be clear..... The correct format for a textarea is....

    <textarea id="XX">
    Code (markup):
    And not:
    <input type="textarea" id="XX" />
    Code (markup):
    as suggested by Rukbat...

    :)
     
    workingsmart, Sep 15, 2011 IP
  19. unknownpray

    unknownpray Active Member

    Messages:
    3,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    70
    #19
    Try making the changes to text area code that you are using in the CSS file, if nothing else is working maybe that will. You are doing nothing wrong here.
     
    unknownpray, Sep 15, 2011 IP
  20. Matt Ridge

    Matt Ridge Peon

    Messages:
    166
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #20
    My book shows
    <input type="textarea" id="XX" />
    Code (markup):


    Why is
    <textarea id="XX">
    Code (markup):
    correct? Wouldn't you want an identifier with it?
     
    Matt Ridge, Sep 19, 2011 IP