PDA

View Full Version : Radio Button Redirects...



alxmiller
02-11-2008, 10:56 PM
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.spywareremoversolution.com/spywarediagnosis.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>SPYWARE &amp; ADWARE
DIAGNOSIS TOOL</b></font></p><hr>
<p>&nbsp;</p>
<p align="center"><b>Before we begin a scan of your PC for
spyware &amp; adware threats, we need to pinpoint the exact problem(s) that you've
been having with your PC. </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.spywareremoversolution.com/spywarediagnosis2.htm"></font></span></font>
Currently, My Anti-Virus Program Finds No Security Threats or Problems</p>
<p align="center">
<span style="background-color: #C0C0C0">
<input type="radio" name="bob" value="http://www.spywareremoversolution.com/spywarediagnosis2.htm"></span>
Currently, My Anti-Virus Programs Finds At Least One Problem or Security Threat</p>
<p align="center">
<span style="background-color: #C0C0C0">
<input type="radio" name="bob" value="http://www.spywareremoversolution.com/noantivirus.htm"></span>
I Do Not Have An Anti-Virus Program</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

alxmiller
02-11-2008, 11:00 PM
Oh yeh, the error reads:

An error has occured in the script on this page

Line: 28
Char: 22
Error: Object Expected
Code: 0
URL: http://www.spywareremoversolution.com/spywarediagnosis.htm

That line refers to the method="submit"

This hurts my head :(

Thanks guys,
Alex

uppercanuck
02-12-2008, 06:25 PM
I just posted a thread with a very similar topic. Did you get it to work? No offense, but I just can't click on a URL with an .exe extension in it, or else I'd try to give you some feedback. I used to have a script that did this a couple of years ago but I can't find it. Ugh!

alxmiller
02-12-2008, 08:12 PM
I just posted a thread with a very similar topic. Did you get it to work? No offense, but I just can't click on a URL with an .exe extension in it, or else I'd try to give you some feedback. I used to have a script that did this a couple of years ago but I can't find it. Ugh!

Lol, fair enough about the .exe link!

Could you click on the .htm link instead on my second post? The weird thing is, is that it works fine when live on the internet, but as soon as i convert it to a .exe it creates problems....

I'm so desperate for a solution now because I really want to distribute this little application....any ideas?

Master_script_maker
02-12-2008, 09:51 PM
method="submit"
there is no method submit, it is either post or get. http://w3schools.com/tags/tag_form.asp

thetestingsite
02-12-2008, 10:00 PM
Also, you do not have a javascript function named checktheform(). Either add that function in the head section of the document or get rid of the call to it in the form tag.

Hope this helps.

alxmiller
02-12-2008, 11:50 PM
Hi guys, thanks very much for your help but I don't understand how to implement the changes.
All i know is the 'post' doesn't work....maybe I need to use 'get'....

Would you at all be able to copy and paste that code with the changes in it, because I can't do it:

Thanks very much - I really appreciate it.
Alex

thetestingsite
02-13-2008, 01:18 AM
Well, I'm not sure what checktheform() is supposed to do, so I'm taking it out of this code.




<!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>SPYWARE &amp; ADWARE
DIAGNOSIS TOOL</b></font></p><hr>
<p>&nbsp;</p>
<p align="center"><b>Before we begin a scan of your PC for
spyware &amp; adware threats, we need to pinpoint the exact problem(s) that you've
been having with your PC. </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="POST" onsubmit="usePage(this, 'bob');">
<p align="center"><font color="#FF0000"><span style="background-color: #C0C0C0">
<font color="#000080">
<input type="radio" name="bob" value="http://www.spywareremoversolution.com/spywarediagnosis2.htm"></font></span></font>
Currently, My Anti-Virus Program Finds No Security Threats or Problems</p>
<p align="center">
<span style="background-color: #C0C0C0">
<input type="radio" name="bob" value="http://www.spywareremoversolution.com/spywarediagnosis2.htm"></span>
Currently, My Anti-Virus Programs Finds At Least One Problem or Security Threat</p>
<p align="center">
<span style="background-color: #C0C0C0">
<input type="radio" name="bob" value="http://www.spywareremoversolution.com/noantivirus.htm"></span>
I Do Not Have An Anti-Virus Program</p>
<p align="center">
<input type="submit" value="Next">
</p>
<p align="center">
</p>
</form>
</div>
</body>
</html>


Looking at the html page you posted a link to, it seems to be working perfectly; however, you say it is something with the exe (which; like the other poster, I am not too found of downloading exe files from an untrusted source).

Hope this helps nonetheless.

alxmiller
02-13-2008, 08:53 AM
Thank you for posting a solution - unfortunately it didn't work.

<method ="post"> has never worked on this, it seems that I have to go with submit, but someone told me not to!!

The thing is, someone directed me to this link initally to get help with redirects, and said to change it for radio buttons - would you know how to?

The link is:
http://www.ftls.org/en/examples/cgi/Redirect.shtml

If I can use that, then I know it will work - but again, I don't know how to!:confused:

Thanks,
Alex