locked
Enforce asp:TextBox Length/Width RRS feed

  • Question

  • User259735815 posted

    How do I enforce the visible width of these controls without anything I set being ignored?  The defaults seem to be taken and given limited table/tr/td space, I need to make them shorter sometimes (also the required data for these form controls don't need as much space sometimes).

    The problem is I set the width in different ways, including some CSS, and it seems to get ignored.  How to I do each asp:TextBox on my form individually with a set width of my own specification, without those settings getting ignored?

    Tuesday, February 23, 2021 4:03 PM

Answers

  • User-943250815 posted

    Set width property should work, try F12 on browser and inspect element style

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 23, 2021 4:33 PM
  • User-1330468790 posted

    Hi dl0dth69,

     

    Could you please share your codes? 

    It should be working if you change the width property directly. However, if you include other elements, you might need to consider the impacts from other containers. 

     

    Another suggestion would be using HTML <input> size Attribute.

    You could try with this link: https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_size

     

    Hope helps.

    Best regards,

    Sean

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 24, 2021 2:24 AM

All replies

  • User-943250815 posted

    Set width property should work, try F12 on browser and inspect element style

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 23, 2021 4:33 PM
  • User-1330468790 posted

    Hi dl0dth69,

     

    Could you please share your codes? 

    It should be working if you change the width property directly. However, if you include other elements, you might need to consider the impacts from other containers. 

     

    Another suggestion would be using HTML <input> size Attribute.

    You could try with this link: https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_size

     

    Hope helps.

    Best regards,

    Sean

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 24, 2021 2:24 AM