/    Sign up×
Community /Pin to ProfileBookmark

using buttons as link to another page

Good day,
I have a “next” button on my html tag. I am trying to use this next button to like to the next page on the same website, but some reason it does not work. Here is my code. I will appreciate all help. if you have a better way of doing this. I will be glad to use that too.

function Payment()
{ window.location =”http://citywideglobal.com/payment“;
}

<INPUT TYPE=”button” Value=”Next” onClick=”Payment()”/>

Thanks

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@skilled1May 22.2009 — [CODE]
<form>
<input
type="button"
value="NEXT"
onclick="location.href='http://www.google.com'" /></form>[/CODE]
Copy linkTweet thisAlerts:
@alobiauthorMay 22.2009 — Thanks skilled1, but I am still not able to display this page

alobi
Copy linkTweet thisAlerts:
@skilled1May 22.2009 — in your code is your input button inside of a form tag?

and try replacing your window.location with location.href

then use the <INPUT TYPE="button" Value="Next" onClick="Payment()"/>
Copy linkTweet thisAlerts:
@alobiauthorMay 24.2009 — Forgive me for not being more explanatory with my last posting and also for my typos. I want to thank you too for taking time to make a sense out of what I was trying to say, thanks. Here is a more detailed Posting.

I have a Next button on a form on page X.htm, I am using this button as a link to another page, page Y.htm on the same site www.xyz.com .

I have the following function and code on the form on page X.htm that is not allowing me to link to page Y.htm, the Next button is also on page X.htm

The function:

<script language=&#8221;JavaScript&#8221;>

Function ()

{ location.href=http://www.Y.htm/

}

The code

<INPUT TYPE="button" Value="Next" onClick=" NextButton()"/>

Please see if this will help you understand my problem.
Copy linkTweet thisAlerts:
@CharlesMay 24.2009 — Good Lord, Why are you using JavaScript for this? It'll fail often enough that you be laughed off the internet. Use instead:&lt;form action="next-page.html" method="get"&gt;
&lt;div&gt;&lt;button type="submit"&gt;Next&lt;/button&gt;&lt;/div&gt;
&lt;/form&gt;
Copy linkTweet thisAlerts:
@alobiauthorMay 26.2009 — Thank you very much the code did the job.
×

Success!

Help @alobi 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...