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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem passing Radio button value

Status
Not open for further replies.

gradinumcp

IS-IT--Management
Apr 6, 2005
85
US
Hi! Here's the code I wrote to pass radio button value to another page however it does not pass any value. Any clues??

*********************MAIN CODE**********************
<td width=2% class=tabletdHL2><center><input type="radio" name="radiobutton" value="<%=Computer("ComputerID")%>"></td>
<td width=10% class=tabletdHL2><%=Computer("ComputerID")%></td>

<td width=6% class=tabletdHL2><input class=fields2 type="button" name="Submit" value="Assign" onclick="Closer('document.Page1.radiobutton.value');"></td>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--

function Closer(val)
{
window.close();
window.open('InsertInventory.asp?Value='+val,target="bottom");

opener.location.reload();
}

//-->
</SCRIPT>

*************CODE FOR INSERTINVENTORY.ASP************

Value=request("Value")

 
Yes - don't pass the radio button details as a string - pass the value as a value:

Code:
onclick="Closer(document.forms['Page1'].elements['radiobutton'].value);"

Incidentally, if you want to target a frame (I'm assuming "bottom" is a frame name), you can do it without JavaScript. Also, your window.open syntax doesn't require "target=" unless you want to assign the value "bottom" to the variable "target".

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top