Hi, I wondered what was involved in creating a script that I can use on a WordPress page. Specifically the person wants a list of radio buttons and when they select the appropriate radio button and hit submit it redirects to a specific URL. Like: Where Are You? Select Canada Radio Button >> Redirects to Canadian Content Page or URL Select USA Radio Button >> Redirects to USA Content Page or URL Thanks
That would actually be fairly easy. You would just have to pass the value of the radio button to a function that depending on the value would link the user to whichever page. Are you looking for the code to do this or just curious as to how easy it is? A programmer with just basic java knowledge should be able to accomplish this fairly easily
If no one else has chimed in by the time i get back to my layer, i'll see what i can put together for an example
Alright I put together a simple example of what it is I'm thinking that your wanting to accomplish. Simple Example of Radio Button Links With submit button <!DOCTYPE html PUBLIC "-//W3C//DTD//XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml : lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>radioButtons</title> <script type="text/javascript"> /* <![CDATA[ */ function sub() { window.location.href = site; } function goTo(URL) { site = URL; } /* ]]> */ </script> </head> <body> <form name="frmSite"> <input type="radio" name="site" onchange="if(this.checked){goTo('http://www.google.com')}"/>Google<br/> <input type="radio" name="site" onchange="if(this.checked){goTo('http://www.youtube.com')}"/>Youtube<br/> <input type="radio" name="site" onchange="if(this.checked){goTo('http://www.facebook.com')}"/>Facebook<br/> <input type="radio" name="site" onchange="if(this.checked){goTo('http://www.ebay.com')}"/>Ebay<br/> <input type="Button" value="Submit" onclick="sub()" /> </form> </body> </html> Code (markup):
That's about all i can do in my power without seeing the site, the code for it, and knowing exactly what your wanting...hope that helps