Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio button selection opens new page w/o submission? PLEASE Help me!

Status
Not open for further replies.

kuolung

Programmer
Sep 2, 1999
51
US
<script language=&quot;JavaScript&quot;>
function oneButton()
{
var radiobut = document.the_form.V2;

if (radiobut.checked == true) {
document.the_form.V2.checked = false;
document.open(&quot;one.html&quot;,&quot;window_name&quot;,&quot;resizable=yes,scrollbars=yes,location=1,menubar=1,toolbar=1&quot;,target=&quot;_top&quot;);

}
}

function twoButton()
{
var radiobut = document.trisnav.V1;

if (radiobut.checked == true) {
document.the_form.V1.checked = false;
document.open(&quot;two.html&quot;,&quot;window_name&quot;,&quot;resizable=yes,scrollbars=yes,location=1,menubar=1,toolbar=1&quot;,target=&quot;_top&quot;);

}
}
</script>


<form name=&quot;the_form&quot; action=&quot;get_list&quot; method=post>

<table>
<tr><td><input type=&quot;radio&quot; name=&quot;V1&quot; value=&quot;VIEW_1&quot; onClick=&quot;oneButton()&quot; checked> VIEW ONE</td></tr>
<tr><td><input type=&quot;radio&quot; name=&quot;V2&quot; value=&quot;VIEW_2&quot; onClick=&quot;twoButton()&quot;> VIEW TWO</td></tr>
</table>

<p>
<a href=&quot;get_list?alpha=a&quot;>A</a> |
<a href=&quot;get_list?alpha=b&quot;>B</a> |
<a href=&quot;get_list?alpha=c&quot;>C</a> |
.
.
.
<a href=&quot;get_list?alpha=z&quot;>Z</a> |

<p><input type=text name=&quot;view_type_srch&quot; size=20 maxlength=20>
<input type=submit value=&quot;Search&quot;>
<input type=reset value=&quot;Clear&quot;>
</form>
---
the above are what i have and it opens a new browser when i select one of the 2 radios. How do i make it to open in same browser?

The problem leads me to this approach is whenever i click on the hyperlink alphabet, the value of radio button doesn't pass, but it works fine when i do the search (view_type_srch), and i have the 2 radio buttons with name (V). Also, in the 'GET_LIST&quot; procedure that i have, whenever you click on any alphabet, it will pass the alpha value and the view type as either VIEW_1 OR View_2
like this
<a href=&quot;get_list?alpha=a&V=VIEW_1&quot;>A</a>

But i Can't do this in the same html page because the value of radio buttion doesn't pass on, and that 's why I want to have it open to another page with similar look (change the default of view to View_2 and all my alpha link to VIEW_2) to to the same browser with my javascript above. please help me, thanks alot in advance.!!!!

[sig][/sig]
 
To have the page open in the same window, replace your document.open statement with
document.location.href=&quot;two.html&quot;
However, you can't change the browser's toolbar, etc properties in a window that's already been created.

[sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
thanks for a quick response but document.location.href doesn't work in this case...any other idea? thanks.

[sig][/sig]
 
what results do you get when you try? [sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
Thank you for your help, i got it work with this statement
location='two.html'
thanks anyway.


[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top