please help... syntax passing radio button values

Results 1 to 2 of 2

Thread: please help... syntax passing radio button values

  1. #1
    Join Date
    Dec 1969
    Posts
    169

    Default please help... syntax passing radio button values

    I have a form that displays a popup window which is also a form. This popup form has radio type values and I&#039;m not sure of the syntax how to get these radio values passed back to the main window. Now when I submit the forms, I will get both the values of the radio button (shipment=standard&shipment=extended). I think something in my for loop & I&#039;ve tried many different ways but the result is still wrong.. can someone please test these 2 pages and see that&#039;s wrong with them?? (You can see the values passed through a string if you look at the url bar). Thanks for your help!<BR><BR>---------------<BR>main.htm<BR>---------------<BR>&#060;HTML&#062;&#060;HEAD&#062;<BR>&#060;SCRI PT LANGUAGE="JavaScript"&#062;<BR>&#060;!--<BR> myPopup = &#039;&#039;;<BR> function openPopup(url) {<BR> myPopup = window.open(url,&#039;win1&#039;,&#039;width=400,h eight=200,location=no,scrollbars=0,status=0,titleb ar=no,toolbar=no,screenX=50,left=210,screenY=200,t op=150&#039;); <BR> if (!myPopup.opener)<BR> myPopup.opener = self; <BR> }<BR> //--&#062;<BR>&#060;/SCRIPT&#062;<BR> &#060;/HEAD&#062;<BR>&#060;body bgcolor="#FFFFFF" onLoad="openPopup(&#039;window.htm&#039;)"&#062;<B R>&#060;form name="hiddenForm" method="get" action="result.asp" onSubmit="return validate(this)"&#062;<BR>&#060;table&#062;&#060;tr &#062;<BR>&#060;tr&#062;&#060;td&#062;&#060;inp ut type="hidden" name="shipment" value="standard"&#062;&#060;/td&#062;<BR>&#060;td&#062;&#060;input type="hidden" name="shipment" value="extended"&#062;&#060;/td&#062;&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td colspan=2&#062;&#060;INPUT TYPE="Submit" VALUE="Submit"&#062;&#060;/td&#062;&#060;/tr&#062;&#060;/table&#062;&#060;/FORM&#062;<BR>&#060;/BODY&#062;&#060;/HTML&#062;<BR><BR>---------------<BR>window.htm<BR>---------------<BR>&#060;html&#062;&#060;head&#062;&#060;title&#0 62;Type of Shipment&#060;/title&#062;<BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR>&#060;!--<BR> function copyForm() {<BR>for (i=0, n=document.popupForm.elements.length; i&#060;n; i++) {<BR> if (document.popupForm.elements[i].checked) {<BR> opener.document.hiddenForm.elements[i].value = document.popupForm.elements[i].value;<BR>opener.document.hiddenForm.submit();<BR > window.close();<BR> return false;<BR> }<BR> }<BR>}<BR> //--&#062;<BR>&#060;/SCRIPT&#062;<BR>&#060;/head&#062;<BR>&#060;body bgcolor="#FFFFFF" text="#000000"&#062;<BR>&#060;form name="popupForm" method="post" onSubmit="return copyForm()"&#062;<BR> &#060;INPUT TYPE="TEXT" NAME="myTextField"&#062;<BR>&#060;table width=300&#062;&#060;tr&#062;<BR>&#060;td align=right&#062;&#060;a href="javascript:openWindow(&#039;standard.htm&#03 9;)"&#062;Standard Shipment&#060;/a&#062;:<BR><BR>&#060;input type="radio" name="shipment" value="standard" CHECKED&#062;&#060;/td&#062;<BR>&#060;td align=right&#062;&#060;a href="javascript:openWindow(&#039;extend.htm&#039; )"&#062;Extended Shipment&#060;/a&#062;:<BR>&#060;input type="radio" name="shipment" value="extended"&#062;&#060;/td&#062;&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td colspan=2 align=center&#062;<BR>&#060;input type="button" value="Submit" onClick="copyForm()"&#062;&#060;/td&#062;<BR>&#060;/tr&#062;&#060;/table&#062; <BR>&#060;/form&#062;<BR>&#060;/center&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR><BR>

  2. #2
    John T. White Guest

    Default RE: please help... syntax passing radio button val

    I am not sure exactly what you are trying to do with this, but I think I know your problem. The reason you are getting shipment in there twice is because of the form on the main.htm. That has to hidden input both named shipment with values stored in them. I am not real sure on what you are trying to do, so it is hard for me to give you a direction on which way to go. Could you post some info on what you are trying to have the form do. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •