Forum Moderators: open

Message Too Old, No Replies

Really Need Help! Radio Button Redirects.

radio button redirects

         

Alex_Miller

10:57 am on Feb 12, 2008 (gmt 0)

10+ Year Member



Hi,

I have been struggling for hours to try and solve this problem - please help me if you can!

Basically, I am trying to create a .exe application to help diagnose users' PC's.

On each page there are a choice of radio buttons...

If the user clicks on radio button #1 and then clicks submit, I want them to redirect to a certain page.

If they click on radio button #2 and then the submit button, I want them to redirect to another page.

etc...

I have got this working when i view it on my website (great!), but when i come to make a .exe application it comes up with errors...

Here is the .exe file:

http://www.example.com...example.exe

If you click on a radio button and then next you will see the error.

I think the problem is do with this: <form action="#" method="submit" onsubmit = "usePage(this, 'bob');return checktheform();">

Here is the code for the page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function usePage(frm,nm){
for (var i_tem = 0, bobs=frm.elements; i_tem < bobs.length; i_tem++)
if(bobs[i_tem].name==nm&&bobs[i_tem].checked)
frm.action=bobs[i_tem].value;
}
</script>
</head>
<body bgcolor="#FFFFCC">

&nbsp;<p align="center"><font size="4" color="#FF0000"><b>SUBJECT</b></font></p><hr>
<p>&nbsp;</p>
<p align="center"><b>Text, text, text</b> <br>
<br>
&nbsp;</p>
<p align="center"><font color="#000080"><b>Please Select One of The Following:</b></font></p>
<p align="center"><br>
</p>
<div>
<form action="#" method="submit" onsubmit = "usePage(this, 'bob');return checktheform();">
<p align="center"><font color="#FF0000"><span style="background-color: #C0C0C0">
<font color="#000080">
<input type="radio" name="bob" value="http://www.example.com/example.htm"></font></span></font>
Text text text</p>
<p align="center">
<span style="background-color: #C0C0C0">
<input type="radio" name="bob" value="http://www.example.com/example.htm"></span>
text text text</p>
<p align="center">
<span style="background-color: #C0C0C0">
<input type="radio" name="bob" value="http://www.example.com/example2.htm"></span>
text text</p>
<p align="center">
<input type="submit" value="Next">
</p>
<p align="center">
</p>
</form>
</div>
</body>
</html>

Thanks very much for your help, I can't wait to crack this!

Many thanks,

Alex

[edited by: engine at 11:20 am (utc) on Feb. 12, 2008]
[edit reason] examplified [/edit]

Alex_Miller

8:13 pm on Feb 12, 2008 (gmt 0)

10+ Year Member



ok, my link got taken out of the message....fair enough. Could anyone look at the code and possibly help? I'll buy them a beer if you can get this working!:)