Results 1 to 2 of 2

Thread: Javascript set button width depending on the length of Text value

  1. #1
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Javascript set button width depending on the length of Text value

    Good day,

    I have button with no width specified.
    The text value of the button differs, so i left it with no width.

    It automatically sets the width but the problem is it to wide with about 5 spaces on each side of text letting the button look stupid.

    I thought of working out the Text in a javascript function then set the length of the button.

    Code:
    <input id="{Description}" type="button" value="{Description}" onClick="{@name}.click(); style="background-color: #f9f9f9; height: 23px;"></input>
    Please help

  2. #2
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Wink

    Got it going - i'm surpirsed no javascript needed.

    Code:
    overflow: visible;padding: 2px 2px 2px 2px;

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
  •