Forum Moderators: open

Message Too Old, No Replies

Form Button

         

dutchmanmike

7:17 pm on Oct 12, 2005 (gmt 0)

10+ Year Member



I want to use the following form with a button:

<form>
<input type="button" class="button" value="Cadillac Mountain Road" onclick="location.href='submit.html'" onfocus="this.blur()" />
</form>

However, I want the value to display

Cadillac
Mountain Road
not
Cadillac Mountain Road

How can I code the 'value' attribute to cause a line break?

Dijkgraaf

11:43 pm on Oct 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried the following
<form>
<input type="button" class="button" value="Cadillac
Mountain Road" onclick="location.href='submit.html'" onfocus="this.blur()" />
</form>

Note that there is a cariage return betweeen Cadillac and Mountain.

dutchmanmike

12:53 am on Oct 13, 2005 (gmt 0)

10+ Year Member



Thanks very much - IT WORKED!

Had to tweek the CSS to get it to display the way I wanted.

islandlizard

2:55 am on Oct 13, 2005 (gmt 0)

10+ Year Member



The solution provided might not work in all browsers, as lf/cr should *not* be rendered by a browser.

You should probably stick to using:

<button type="button" name="test">Some text<br />With a break</button>

As this is far more flexible ( you can use images, html tags, etc, between the <button> tags

HTH