SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Learning...
    Join Date
    Jan 2003
    Posts
    778
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MVC 2 - text box width (size)

    Hi,

    I am specifying the size but the textbox is still getting the default size. How can i fix this?

    Code:
    
    <%= Html.TextBoxFor(model => model.EnvelopeID, new { maxlength = "8", size = "4" })%>
    
    html
    Code:
     <inputid="EnvelopeID" maxlength="8" name="EnvelopeID" size="4" type="text" value="" />
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  2. #2
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Try encapsulating things into a css class.

    Code ASP:
     
    new { class = "myTextBox" }

    And in your css file.

    .myTextBox
    {
    width : 40px; // example only, play with the size.
    }

  3. #3
    Learning...
    Join Date
    Jan 2003
    Posts
    778
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Different text boxes have different widths. This solution will make create a class for all the widths.
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  4. #4
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Yes, it would. =)


Bookmarks

Posting Permissions

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