/    Sign up×
Community /Pin to ProfileBookmark

Question About Link Buttons

I know the script for making link buttons, what I need to know is. Is it possibe to put two lines of text on one button?

Like…….

Bears Home Page
Where Life Is Good

to post a comment
JavaScript

15 Comments(s)

Copy linkTweet thisAlerts:
@NevermoreMay 18.2003 — What do you mean - like this:

[CODE]
[URL=http://www.evernet.co.uk]Visit my site
which is really good
and only started today[/URL] [/CODE]
Copy linkTweet thisAlerts:
@AdamGundryMay 18.2003 — Do you mean a HTML <button> element?

http://www.w3.org/TR/html401/interact/forms.html#edef-BUTTON

Adam
Copy linkTweet thisAlerts:
@bearauthorMay 18.2003 — This is what I was talking about. I can not get two lines on the button. Is it possible to do?

<HTML>

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function goToURL() { window.location = "http://javascript.internet.com/new"; }

// End -->

</script>

</HEAD>

<BODY>

<form>

<input type=button value="Bears Home Page" onClick="goToURL()">

</form>

</BODY></HTML>

I would have posted an image of the button, but for somr reason they have the img thing turned off..... So I posted the code
Copy linkTweet thisAlerts:
@AdamGundryMay 18.2003 — You can do this:

<button onClick="goToURL()">Line 1<br>Line 2</button>

Adam
Copy linkTweet thisAlerts:
@David_HarrisonMay 18.2003 — Why not do something like this:

<input type="button" value="Line 1nLine 2nLine3">
Copy linkTweet thisAlerts:
@AdamGundryMay 18.2003 — Uh...because it doesn't work. The <button> element is designed for buttons with graphics/HTML formatting, whereas <input> only allows a limited range of formatting.

Adam
Copy linkTweet thisAlerts:
@David_HarrisonMay 18.2003 — What do you mean it doesn't work, if you put that code on an HTML page it will make a button (that doesn't do anything) with 3 lines of text on it.
Copy linkTweet thisAlerts:
@brendandonhueMay 18.2003 — No it really doesn't work, it just says Line 1nLine 2nLine3

on the button. n does not create a new line on input type button.
Copy linkTweet thisAlerts:
@CharlesMay 18.2003 — [font=georgia]And bear's form will not do anything at all on one in ten browsers. But with a little adjustment all will be well...[/font]

[font=monospace]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta name="Content-Script-Type" content="text/javascript">

<title>A Bear of an Example</title>

<form action="http://javascript.internet.com/new">

<div>

<button type="submit">Bears<br>Home<br>Page</button>

</div>

</form>[/font]
Copy linkTweet thisAlerts:
@bearauthorMay 19.2003 — Hello Charles, you said the java script code I had would not work in one in ten browsers. Why?

I'm not questioning your statement my friend, you see I know nothing about java script and very little about HTML. (I got that script from a script website). But I'm trying to learn this stuff. It difficult at times being new to computers. But this cyber world and all its little mysteries just excites the proverbial brown stuff out of me.

Food and water will sustain the body, but knowledge is food for the soul..... the bear said that


PS: I tried your code, yours and the one Adam gave me both work. Thank you ?
Copy linkTweet thisAlerts:
@web-eagleMay 19.2003 — He’s probably referring to the current wisdom that says 10% of all browsers have javascript disabled for whatever reasons. Only pure HTML can hope to reach those poor lost souls.
Copy linkTweet thisAlerts:
@CharlesMay 19.2003 — [font=georgia]Some of those "poor lost souls" cannot use browsers with JavaScript because of disabilities. Some, like myself, are simply defending ourselves from having our windows resized.[/font]
Copy linkTweet thisAlerts:
@bearauthorMay 19.2003 — Charles, ya lost me my friend. Disabilities? Windows Resized? Please explain!


The Early Bird Gets The Worm. Heck, it did not do the worm any good getting up early. Besides, I'm not a Bird, I don't eat worms. Think I'll just stay in bed........

the bear said that ?
Copy linkTweet thisAlerts:
@CharlesMay 19.2003 — [font=goergia]See http://www.w3.org/WAI/gettingstarted/.[/font]
Copy linkTweet thisAlerts:
@NevermoreMay 20.2003 — Basically, audio browser for the blind or specialized browsers for people who cannot use mice/keybords often [B]do not[/B] support JavaScript.
×

Success!

Help @bear spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...