How do you wrap the text on an input field with type="button"

I want to put 2 lines of text on an input field.
The button size is fixed at 75 and if there is more than 10 characters it truncates the text.
The input field is defined as :
<input type="button"
value="CI<br>Discrepency"
class="buttons75x75"
onclick="javascript:callForm('ciDiscrepency');"/>
If you can show me how, I would really appreciate it.
-Gary

Dug up the code I used to do this a while back:
//The style sheet
  <style type="text/css">
    .buttonUp {
      border-style:outset;
      border-width:2px;
      width:3em;
      float:left;
      padding:2px;
      background-color:#ccc;
      text-align:center;
    .buttonDown {
      border-style:inset;
      border-width:2px;
      width:3em;
      float:left;
      padding:2px;
      background-color:#ccc;
      text-align:center;
</style>
//... Example buttons
  <div class="buttonUp" onmousedown="this.className='buttonDown';"
                        onmouseup="this.className='buttonUp';"
                        onclick="alert('Clicked on Small One');">He</div>
  <div class="buttonUp" onmousedown="this.className='buttonDown';"
                        onmouseup="this.className='buttonUp';">Hello</div>
  <div class="buttonUp" onmousedown="this.className='buttonDown';"
                        onmouseup="this.className='buttonUp';">Hello World</div>
  <div class="buttonUp" onmousedown="this.className='buttonDown';"
                        onmouseup="this.className='buttonUp';">Hello<br/>World</div>
  <div class="buttonUp" style="width:5em;" onmousedown="this.className='buttonDown';"
                        onmouseup="this.className='buttonUp';">Hello World</div>You could put any javascript you want on the onclick event, so you would call the javascript you previously used to submit the form and set the input name. In this example I had all the buttons be a fixed width, if you leave out the width in the style sheet then the block will snap to fill the same width as the text inside it, much like normal buttons do. The difference is, with a fixed width then text wrapping occurs automatically (like in the 3rd button) while without a defined width the div will only display a second line when the line break is added. Note the the fixed width can be over-ruled by an inline style if needed (last sample).
The website I pointed to before has a simpler solution (less javascript events needed). An implementation for his approach would be:
//The style sheet
  <style type="text/css">
    .button {
      border-style:outset;
      border-width:2px;
      color:#000;
      float:left;
      padding:2px;
      background-color:#ccc;
      text-align:center;
      text-decoration:none;
      display:block;
    .button:active {
      border-style:inset;
      border-width:2px;
      color:#000;
      float:left;
      padding:2px;
      background-color:#ccc;
      text-align:center;
      text-decoration:none;
      display:block;
  </style>
//... Example buttons
  <a class="button" href="#" onclick="this.blur();alert('Now you clicked linkey');return false;">Hello<br/>World</a>Same deal here with the fixed-width vs.fit-to-content. I add the 'return false;' to the list of the onclick commands so IE doesn't make the 'link clicked' noise and the URL doesn't go to thispage.html#.
All these buttons work in FireFox 2, IE 7, and Safari 3 if they are running in STRICT mode. The button colors and borders don't precisely match FF and IE buttons, but they are close (although they aren't close at all to Safari buttons).

Similar Messages

  • How do you set the text of a Hyperlink component in code

    I am using Visual Web pack in NB 6.0. How do you set the text of a hyperlink component in code?
    Please see screenshots at
    http://coba.usf.edu/departments/isds/faculty/agrawal/projects/java/
    I have a hyperlink in a grid panel. I am using
    hyperlink1.setText("Hello"); in prerender(),
    but the Hyperlink shows up with the text "Hyperlink", whereas I was expecting "Hello". However,
    hyperlink1.setUrl("http://www.usf.edu"); works as expected.
    I tried nesting a static text in the hyperlink as suggested in the Creator guide (ed 2, Google project). I deleted the "Hyperlink" text in the properties editor but then the page turned out blank.
    Thanks
    Manish

    Hi Manish,
    Great to know you were able to fix your issue. The following blog entry has the list of resources you would like to look at for future.
    http://blogs.sun.com/NetBeansSupport/entry/useful_resources_for_visual_web
    Thanks
    K

  • How do you change the text font on the Droid Global Phone

    How do you change the text font on the Droid Global Phone. I would like it to be darker (like bold)

    Hi.  
    Below I have provided you with the steps to change your font settings.
    From the main menu
    Select Settings
    Select Display Settings
    Select Font Style
    You can select from what is available, 
    Or you select [Get Fonts Online] to find something you want.
    Thank you,

  • How do you change the text color in your junk mail folder

    How do you change the text color in your junk mail folder?

    Try Mail Preferences/Junk tab and under " When Junk Mail Arrives" click Performe Custom Action then advanced
    you will see the option for colors.
    Hope this helps

  • How do you change the text color in io7 from white to black?

    How do you change the text color on the home page in iO7 from white to black?  I tried to invert the color but that reverses everything inclufing pictures.

    Yes, you can. If you change your wallpaper to a very light or white color the text turns black.

  • How do you change the text in portrait mode.

    How do you change the text in portrait mode.  I can edit it in landscape, but when I change the view the Latin and photos can't be edited and swapped with my material.  Thanks

    iBA should be approached like this:
    layout in landscape
    edit in portrait
    - -  check in both on your device
    Use the 'disable portrait orientation' option (Inspector/Document) for layouts you just don't see working in any manner but landscape.

  • HT3529 If you have an IPod touch, how do you change the text tones???

    How do you change the text tone on the IPod's Message???

    Open settings, go to sounds, and then your text tone settings should be there

  • How do you get the text box text properties dialog box to appear on a MAC?

    how do you get the text box text properties dialog box to appear in Adobe Reader XI on a MAC? I know windows is Ctrl-E but can't figure out what to hit for Mac.

    Right-click the toolbar and you should find it there (including the short-cut, which is probably Cmd+E).

  • HT3384 How do you set the text layout in Pages on the vertical? How do you center the text?

    How do you align the text vertcially?

    Stru,
    You posted your question in the Pages (word processor) discussion area. Hope you can find your way back to Excel without any difficulty. The answer wouldn't have been much different had you posted in the Numbers discussion.
    Jerry

  • How do you correct the merging of contacts, calendars, etc with other members of your family on your account?

    How do you correct the merging of contacts, calendars, etc with other members of your family on your account?

    Wow!
    I'm not going to be of much use regarding answers but I sure am going to watching this post like a hawk for any replies. My package is a slightly diluted version of this and I do find the BBtalk and data limits hard to make the most of as well.
    If nothing else this totally highlights how complicated BT have managed to make their packages.
    A cynic would assume that they are trying to catch us out at every step and for us to either be overspending or not really getting the moneys worth.

  • How do you count the multiple columns of a field in a table

    How do you count the multiple columns of a field in a table

    Hi,
    4396bf34-e890-4202-a6b0-4e08c9ff0e89 wrote:
    How do you count the multiple columns of a field in a table
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    "Field" isn't a standard database term.  Some people say "field" when they mean "column", but I don't think that's what you mean ("How do you count the multiple columns of a column ..").  Do you want to know how many times a column is used (as opposed to NULL), or the number of different values in a column?  You really need to show what you want.

  • How can I wrap the text for LinkToAction UI Element.

    Hi All,
    I am trying to wrap the text for LinkToAction UI Element which is inside the group.I have set the wrap property to be true.But still its not getting wrapped.I have set the width of the group to be 0px.I have even set the wrap property for the RootUIElementContainer and set the width property to be 0 px.I am using the FlowLayout.Any ideas are appreciated.
    Thanks in Advance

    I have the same problem.
    would you plz tell me how to wrap.

  • How do you start the hardware test on an imac with bluetooth keyboard

    How do you start the apple hardware test on an imac with a bluetooth keyboard as the instructions is to press the D key whilst restarting? And of course the imac cant see the keyboard whilst booting up as the bluetooth connection has yet to be established

    Have you tried following the directions for running it from the DVD? The instructions are on the Hardware Test link.If you are correct and it cannot due to the wireless keyboard not making a connection you will need to borrow a wired USB keyboard.  

  • How do you rotate the text inside a wedge on a Keynote or Numbers chart?

    I'm trying to create a pie chart and would like to rotate the text in some of the wedges on the chart. If I open a new text box, it will allow me to rotate the box. For labels generated by the spreadsheet data, I cannot figure out how to do the same thing. Any ideas are greatly appreciated.

    You would need to add a custom text box and rotate that as the rotate tool is not assigned to wedge labels

  • How do you set the Text in an Accordion Interaction?

    When trying to set the text in the Accordion Interaction, it behaves very strange. You can't set it. It starts out at 13 and then changes to either 10 or 30.
    Can anyone give some advise on how to set this?
    Thanks.

    Hello,
    Logged that bug (as well, have a long list). Workaround depends on your hardware: for some scrolling the mouse wheel will allow to change font size (doesn't work for me). On my Lenovo Thinkpad I have to use the trackpad, that has a scrollbar, to change the font size. Very cumbersome, was promised that it would soon be patched, crossing my fingers.
    Lilybiri

Maybe you are looking for

  • Issue with 'modified by' on LiveCopies

    Hello everybody, we're facing a slightly perplexing issue on our CQ5.4 installation: when using 'Rollout Page', the page is rolled out to the correct livecopies, and the 'Modified' columns on the livecopies correctly show the author that performed th

  • Error while activating the function module

    hi, am getting error while activating the function module i.e. program or report statement is missing. thank you in advance karthik

  • HP-UX was not able to run jvmstat2.0 (please see further details)

    Good day! I would like to ask your help with JVMstat. Because for some reasons it is not working properly when I installed it on my HP-UX server. My HP-Ux has this software installed. JDK 1.4.2 Jvmstat2.0 (Unix) running on HP-UX Some Details: 1.) I h

  • Error in good receipts for sch.agreement

    hi frnds,    while i make gr w.r.t sch.agreement. it is telling that " Document xxxxxxxxx does not contain any items ". i have maintained delivery schedules in day format. and iam trying to do gr in tht date too. but still it is not showing. how coul

  • BOM verification before saving

    Hi, I need to do BOM adjustments with program code.  Because there is no way remove or update a BOM line with code, I have to copy the original BOM to another BOM making changes along the way.  When done I have to remove the original BOM and then sav