Development html button widths

Discussion in 'Software' started by OneSeventeen, 29 Oct 2003.

  1. OneSeventeen

    OneSeventeen Oooh Shiny!

    Joined:
    3 Apr 2002
    Posts:
    3,454
    Likes Received:
    2
    I just want to make a button in a form that runs some javascript when I click it.
    I've been doing it with:
    <input type='button' name='bob3' value="8 PM Nights & Weekends" onClick="javascriptstuff">

    So when displayed, it looks something like this:
    Code:
    +------------------------------+
    |    8PM Nights & Weekends     |
    +------------------------------+
    Can I make it:
    +---------------------+
    |8PM Nights & Weekends|
    +---------------------+
    I've got like 15 of these on screen and it's hard to get them to fit when they are all spacing out.
     
  2. zenzelezz

    zenzelezz What's a Dremel?

    Joined:
    5 Oct 2003
    Posts:
    9
    Likes Received:
    0
    Using CSS you could make it a specific width, for example 100 pixels. If you don't wish to use CSS, I'm not sure if you can accomplish it.

    -- zenzelezz
     
  3. RTT

    RTT #parp

    Joined:
    12 Mar 2001
    Posts:
    14,120
    Likes Received:
    74
    You mean you just want the text to fit the button better?
    CSS is your friend
     
  4. OneSeventeen

    OneSeventeen Oooh Shiny!

    Joined:
    3 Apr 2002
    Posts:
    3,454
    Likes Received:
    2
    meaning I've got 15 variable length names in a database that could change, and I want to pull them out and slap them on a button.
    I've used CSS to say padding:0; and margin:0; but it didn't change anything. (everyone is using IE 5.5)
     
  5. webchimp

    webchimp What's a Dremel?

    Joined:
    9 Oct 2002
    Posts:
    504
    Likes Received:
    1
    Could you achieve the button functions with links?

    If so you could create some fake buttons using images and HTML, something like THIS

    If you need to submit a form, just use a bit of JavaScript on the link: <a href="javascript:formName.submit();">Button Text</a>
     
  6. OneSeventeen

    OneSeventeen Oooh Shiny!

    Joined:
    3 Apr 2002
    Posts:
    3,454
    Likes Received:
    2
    I ended up just setting some onClick events for the <td> cells the item was in.

    The problem came when we found out instead of checking a box for each 'feature', the users needed to be able to add multiple items to each 'feature'.

    The problem is when using text when you click two or three times it selects the text, making it look funny and 'feel' awkward to use. The button was perfect, except for the sizes.

    It doesn't look as good as it could, but it is much better than what we were using.

    As for using the images, for some reason the style="cursor:pointer;cursor:hand" doesn't take, which is a vital part of the application, right? =P
     

Share This Page