PDA

View Full Version : Selecting radio buttons of other site from click of text link on my homepage



Harleyy
07-28-2011, 06:15 AM
Hello every one,

I am having a blog which is
http://renderingminds.wordpress.com

At the end of it I have a link which should redirect to my other blog which is
http://renderingminds.blogspot.com and onclick of this text link, it should select the radio button "Designing, coding and scripting tutorials" in the redirected blog (http://renderingminds.blogspot.com) and it should just make the user to click submit and cast the vote.

The only purpose of doing this is to prevent the user from going and selecting and then clicking it.

The form code that I have on http://renderingminds.blogspot.com is below


<form method="post" action="http://poll.pollcode.com/sFaj">
<table border=0 width=150 bgcolor="EEEEEE" cellspacing=0 cellpadding=2>
<tr><td colspan=2><font face="Verdana" size=-1 color="000000"><b>What topics you want to include in this blog?</b></font></td></tr>
<tr><td width=5><input type=radio name=answer value="1"></td><td><font face="Verdana" size=-1 color="000000">Sports</font></td></tr>
<tr><td width=5><input type=radio name=answer value="2"></td><td><font face="Verdana" size=-1 color="000000">Designing, coding and Scripting Tutorials</font></td></tr>
<tr><td width=5><input type=radio name=answer value="3"></td><td><font face="Verdana" size=-1 color="000000">Movies</font></td></tr>
<tr><td width=5><input type=radio name=answer value="4"></td><td><font face="Verdana" size=-1 color="000000">Anything that sounds cool</font></td></tr>
<tr><td colspan=2><center><input type=submit value="Vote">&nbsp;&nbsp;<input type=submit name=view value="View"></center></td></tr>
<tr><td bgcolor="white" colspan=2 align=right><font face="Verdana" size=-2 color="black">pollcode.com <a href=http://pollcode.com/><font color="navy">free polls</font></a></font></td></tr>
</table>
</form>

Awaiting solutions.
Regards
Harley

vwphillips
07-28-2011, 08:38 AM
P1.htm


<!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>
<title></title>
</head>

<body>
<a href="P2.htm?1">LINK</a>
</body>

</html>



P2.htm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
</head>

<body>
<form name="tom" >
<input type="radio" name="fred" />
<input type="radio" name="fred" />
<input type="radio" name="fred" />

</form>
<script type="text/javascript">

var nu=window.location.toString().split('?')[1];

if (document.tom&&document.tom.fred&&document.tom.fred[nu]){
document.tom.fred[nu].checked=true;
}

</script></body>

</html>

Harleyy
07-28-2011, 09:04 AM
Thanks a lot. It works great.

The only question I want to ask here is that if I have to do a polling to a website, say for example http://www.wayoutwest.org/cgi-bin/surveys.cgi?action=ballot&survey=3 and if i want to have the link on my home page which by clicking selects any of their option like say it should select the Buster the dog (Early to Bed ).

So what I need to do then to make that work??

vwphillips
07-28-2011, 09:57 AM
<!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>
<title></title>
</head>

<body>
<a href="P2.htm?3">LINK</a>
</body>

</html>


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
</head>

<body>

form names must not start with a number
<FORM ACTION="surveys.cgi" METHOD=POST><INPUT TYPE=hidden NAME=action VALUE=write>
<INPUT TYPE=hidden NAME=survey VALUE=3><BR><CENTER><P><TABLE CLASS="graybox" BORDER=0 BGCOLOR="#CCCCCC" CELLPADDING=0 WIDTH=450><TR><TD><TR><TD VALIGN=middle WIDTH="120" HEIGHT=25 COLSPAN=2><P><B>Which was your favorite animal in a Laurel & Hardy film?
</B></P><P><INPUT TYPE=radio NAME=R3 VALUE="The alpine gorilla">The alpine gorilla (<I>Swiss Miss </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Blue Boy the horse">Blue Boy the horse (<I>Wrong Again </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Buddy the dog">Buddy the dog (<I>The Perfect Day </I>)</P>

<P><INPUT TYPE=radio Name="R3" VALUE="Buster the dog">Buster the dog (<I>Early to Bed </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Dinah the mule">Dinah the mule (<I>Way Out West </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Ethel the chimp">Ethel the chimp (<I>The Chimp </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Laughing Gravy the dog">Laughing Gravy the dog (<I>Laughing Gravy </I>)</P>

<P><INPUT TYPE=radio Name="R3" VALUE="Narcissus the goat">Narcissus the goat (<I>Saps at Sea </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Ollie the horse">Ollie the horse (<I>Flying Deuces </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Ollie the chimp">Ollie the chimp (<I>Dirty Work </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Penelope the goat">Penelope the goat (<I>Angora Love </I>)</P>

<P><INPUT TYPE=radio Name="R3" VALUE="Penelope the crow">Penelope the crow (<I>Great Guns </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="St. Bernard">St. Bernard (<I>Swiss Miss </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="Susie the horse">Susie the horse (<I>The Music Box </I>)</P>
<P><INPUT TYPE=radio Name="R3" VALUE="writein">Other <INPUT TYPE=text NAME="writein" VALUE="" SIZE=30 MAXLENGTH=30></P>

<BR><BR>
<P>Please check over your answers, then submit the form.</P>
<P><INPUT TYPE=submit NAME=Submit VALUE="Cast Your Vote">&nbsp;<INPUT TYPE=reset VALUE="Reset Ballot">
</TABLE></P></TD></TR></TABLE></P></TD></TR></TABLE><BR></CENTER>
</FORM> </DIV>
<script type="text/javascript">

var nu=window.location.toString().split('?')[1];
var frm=document.forms[0];
if (frm&&frm.R3&&frm.R3[nu]){
frm.R3[nu].checked=true;
}

</script></body>

</html>

Harleyy
07-28-2011, 10:04 AM
That is fine sir, but I am not going to paste the <script> on their site page, I am just going to click the link button and that should take me to the site online where they have their form without the script, how can i make it clickable so that it opens the Online URL and in that form the Buster the dog (Early to Bed) radio button becomes selectable?

vwphillips
07-28-2011, 11:01 AM
I miss understood


That is fine sir, but I am not going to paste the <script> on their site page, I am just going to click the link button and that should take me to the site online where they have their form without the script, how can i make it clickable so that it opens the Online URL and in that form the Buster the dog (Early to Bed) radio button becomes selectable?

no idea

Harleyy
07-28-2011, 11:08 AM
Let me explain.

The script is fine and working well when the htm are on my own PC and I have a control over them.

The htm http://www.wayoutwest.org/cgi-bin/surveys.cgi?action=ballot&survey=3 is where I want the radio buttion for the option Buster the dog (Early to Bed ) gets selected when I click the LINK.

Now, The Link Htm will be under my control and in my machine, but the other URL is totally external and out of my reach to edit.

I just want to know that can we do something so that When I click on Link, it opens the URL and we can get the radio button selected??

Sorry for trouble, hope its clear.
Let me know if you want me to explain further.