/    Sign up×
Community /Pin to ProfileBookmark

Hi there,

I am trying to get this button to take me to the ahref but clearly I’m doing something wrong becuase its not working. Had scout round but couldnt see anything of any help out there. Any ideas?

<input type=”submit” name=”checkout” value=”Proceed to checkout” class=”login-button” onClick=”<A href=”{checkout.link}”></a>”>

Cheers Si.

to post a comment
Full-stack Developer

4 Comments(s)

Copy linkTweet thisAlerts:
@HaganeNoKokoroAug 11.2005 — If you want a button to just take you to an href, this is probably the best way: &lt;form method="GET" action="{checkout.link}"&gt;
&lt;input type="submit" name="checkout" value="Proceed to checkout" class="login-button"&gt;
&lt;/form&gt;
The other thing you were trying was javascript-dependent, meaning it would not work for users with javascript disabled. This way submits a form with no data, taking the user to the page {checkout.link}
Copy linkTweet thisAlerts:
@SimonBahrauthorAug 11.2005 — Thanks for the code but it didnt seem to work the page just represents itself and doesnt go to the link.

Please see your code and the link that works: ?

<br></br>

<form method="GET" action="{checkout.link}">

<input type="submit" name="checkout" value="Proceed to checkout" class="login-button">

</form>

<br></br>

<A href="{checkout.link}" class="blue-hyperlink-text">labels.navigation.checkoutLink}</a>

<br></br>
Copy linkTweet thisAlerts:
@buntineAug 11.2005 — What about:
<i>
</i>&lt;input type="button" name="yourlink" value="Click Me" onclick="window.location='somePage.html';" /&gt;

You cannot actually render markup within an event like that.

Regards.
Copy linkTweet thisAlerts:
@HaganeNoKokoroAug 12.2005 — Complete example follows (button goes to google.ca): &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 STRICT//EN" "http://www.w3.org/TR/HTML401/strict.dtd"&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;Button Test Page&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form method="GET" action="http://www.google.ca"&gt;
&lt;div&gt;&lt;input type="submit" value="Go to Google.ca"&gt;&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
This works, assuming the action attribute of the form is a real, working url. Validated at validator.w3.org.
×

Success!

Help @SimonBahr 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.3,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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