Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 20th, 2003, 06:39 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Radio buttons - link to URL

I want to have (2) radio buttons at the botton of my Accept/Cancel page that I am writing.

<center></center>O Accept O Don't Accept
(neither of this should be ticked by default and should be able to toggle between the two. Tic one and the other un-tics and vise-versa)

If the user tics the "Accept" radio button, they would go to a url called http://www.networkdriven.com/open.htm

If the user tics the "Don't Accept" radio button, they would go to a url called
http://www.networkdriven.com/close.htm

I guess this is done using the <form> tags but I don't know how to write the code.
Would anyone be so kind as to write this out for me?

I would really appreciate it!!!

Larry
__________________
Rudy
 
Old November 20th, 2003, 07:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Radio buttons have an onClick event which you should use with some Javascript to tell which of the buttons was selected and then you can use simple Javascript to change the URL.

There is plenty of info on the web on this, but if you need a sample let us know.
 
Old November 20th, 2003, 08:02 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by larry
 I got this to work with the following code but I don't think the syntax is correct, a sample would help.

<html>
<head></head>

<body bgcolor="#ffffff">
<center>

<INPUT TYPE="radio" NAME="aRadio" VALUE="http://javascript.faqts.com" ONCLICK="location.href = this.value" > Accept &nbsp;&nbsp;&nbsp;<INPUT TYPE="radio" NAME="aRadio" VALUE="http://www.networkdriven.com" ONCLICK="location.href = this.value" > Don't Accept

</center>
</body>
</html>

----------------------------------------

Quote:
quote:Originally posted by Greg Griffiths
 Radio buttons have an onClick event which you should use with some Javascript to tell which of the buttons was selected and then you can use simple Javascript to change the URL.

There is plenty of info on the web on this, but if you need a sample let us know.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Radio Buttons jonsey Classic ASP Professional 1 June 6th, 2007 11:48 PM
Radio buttons disappear JoeBob49 ASP.NET 2.0 Basics 2 November 27th, 2006 09:57 AM
How to use the radio buttons? ben_VB VB.NET 2002/2003 Basics 1 January 18th, 2005 12:29 PM
Radio buttons over email??? morpheus Classic ASP Basics 5 April 20th, 2004 01:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.