Click to See Complete Forum and Search --> : HELP! Click radio button, go to URL


Duke Will
07-27-2003, 11:59 AM
I'm going around in circles. I'd rather NOT do this in java but in something that is used by all browsers. I just want to display a list of radio buttons. When they click on a button (or click a SUBMIT button but it would be easier on them if it opens the new page when they just click the button), it opens a new window (target="_blank" ?)with the new page. I was trying to do it with FORM but I don't know... stuck.

It doesn't have to open a new window but maybe that's best. Doens't really matter.

I'd rather just use something in HTML if possible.

---

EDIT: Until someone tells me ;) I figured I could do it by using an image rather than a real radio button. I created this page -- http://www.dukewill.com/testform.html (test page) and the images are smiley faces. I could not find a .gif image of a radio button but surely I can, eventually.

If anyone knows a better way, help.

The code I used for my work-around...

<HTML>
<HEAD>
<TITLE>Song Examples, DukeWill.com</TITLE>
<style type="text/css">
<!--
body {font-family:Arial, sans-serif}
-->
</style>
</HEAD>
<BODY>
<CENTER>
<TABLE>
<TR>
<TD><FORM ACTION="http://www.dukewill.com/forum/viewtopic.php?t=4" METHOD=GET>
<input border=0 type="image" src="images/icon_biggrin.gif" ALT="Click me"></FORM></TD>
<TD>&nbsp;A love gone right song</TD>
</TR>
<TR>
<TD><FORM ACTION="http://www.dukewill.com/forum/viewtopic.php?t=5" METHOD=GET>
<input border=0 type="image" src="images/icon_biggrin.gif" ALT="Click me"></FORM></TD>
<TD>&nbsp;A love gone wrong wong</TD>
</TR>
</TABLE>
</CENTER>
</BODY>
</HTML>

When I click on the smiley face, it DOES take me to the URL. I'm getting an error saying "page does not exist." Have no clue why that is happening but I guess it has nothing to do with my HTML... something on my forum I guess.

David Harrison
07-27-2003, 05:30 PM
You could do this:

<form name="w3c" action="http://www.w3.org/" method="post">
<input name="gotow3c" type="submit" value="Go to W3C">
</form>

<form name="caulolli" action="http://www.w3.org/" method="post">
<input name="gotocaulolli" type="submit" value="Go to Caulolli">
</form>

but unfortunately, opening in a new window would only be a distant dream with this method.

Duke Will
07-27-2003, 06:09 PM
Uh, I'm trying to use radio buttons. What you did will work and the method I am using above will work... if I could find a radio button .gif file, it would look like radio buttons. But if I can use "real" radio buttons... when they click a radio button, it opens a new URL, that's what I'm trying to do... NOT use a SUBMIT button.

Originally posted by lavalamp
You could do this:

<form name="w3c" action="http://www.w3.org/" method="post">
<input name="gotow3c" type="submit" value="Go to W3C">
</form>

<form name="caulolli" action="http://www.w3.org/" method="post">
<input name="gotocaulolli" type="submit" value="Go to Caulolli">
</form>

but unfortunately, opening in a new window would only be a distant dream with this method.

David Harrison
07-27-2003, 06:30 PM
I did some screen shots and look what came out:

Duke Will
07-27-2003, 07:30 PM
Thanks, I used one. In about middle of the page at http://www.dukewill.com/go.html (site I am working on).

David Harrison
07-30-2003, 01:21 PM
Happy to help. :)

pyro
07-30-2003, 01:37 PM
Originally posted by lavalamp
unfortunately, opening in a new window would only be a distant dream with this method. Not at all... You just use the target attribute:

<form name="w3c" action="http://www.w3c.org/" method="post" target="_blank">
<input name="gotow3c" type="submit" value="Go to W3C">
</form>

David Harrison
07-30-2003, 01:39 PM
Really? i didn't kow you could do that with forms.

pyro
07-30-2003, 01:48 PM
Yes, you can do it, but it has a very definite downside. It won't validate 4.01 Strict. You'll have to use Transitional...

David Harrison
07-30-2003, 01:50 PM
That's because opening new windows is bad, apparently.

pyro
07-30-2003, 01:56 PM
Yeah, I think it's because of accessibility issues.