Redirect buttons

They have: 5 posts

Joined: Nov 2005

Hello,

I'm hoping this is an easy one for most of you Shocked)

How do I make two buttons to do the following?

button 1: [Agree] when clicked goes to designated webpage
button 2: [Disagree] when clicked goes to a different designated webpage

Thanks,
MonaE

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Is this what you're talking about?

Busy's picture

He has: 6,151 posts

Joined: May 2001

using onclick redirect is bad, as people can just view the source and go there without filling in the form.

just have your reset and submit - with values agree and disagree, and use an if statement to redirect to which ever one they do, the forms action is the same page btw.

if submit = agree send to agree page
elseif reset = disagree send to disagree place
else just display page again

the page
the form

I'm guessing this is a sign up page or something where as the person has to agree with your terms and conditions or something. If so be sure to use a checkbox for them to check as a lot of form bots can bypass this process

They have: 5 posts

Joined: Nov 2005

Hello Busy,

I like your logic. Currently I have:

<script language="javascript">
function goURL1() {
window.document.location.href = 'http://www.elkgrovecity.org/gis/downloads.htm';
}

function goURL2() {
window.document.location.href = 'http://www.elkgrovecity.org/gis/default.htm';
}
</script>

I would really like to do it the way you describe, but do not have enough knowledge on how to create from your email Shocked( Can you help Shocked)

MonaE

Busy's picture

He has: 6,151 posts

Joined: May 2001

The way I described was with server side (PHP, ASP etc) as this was posted in that section, with Javascript it would not be hidden.
Are you able to do it in PHP or ASP or something?

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Sorry, MonaE didn't mention having a form that had to be filled out. I also didn't make a note of what forum this was in. (My fault.)

Of course, Busy is right, and it will have to be server side (not JavaScript or HTML) if you want the URLs to be completely hidden.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.