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

pass value of checkbox from child to parent window

Status
Not open for further replies.

rk68

Programmer
Jul 15, 2003
172
IN
Hi everybody,

The child window consists of name and checkboxes. The user can check more than one checkbox. All the values of checkbox has to be shwn in the list box of the parent form. Please help with code & examples.

Thanks & regards,
RK68
 
If you don't mind re-loading the parent form, assign a variable to the checkbox (in a form):
<input type=checkbox value="checked" name="pizza">

Then, on submit, have the parent form as the action. In this way, you will now have access to $pizza in your parent form.

Now right the parent form so that under the list box you have something like:

Code:
<?php 
if ($pizza == "checked")
{
  echo "<option>Pizza</option>\n"
}
?>

If you don't want to have to reload the form, then you are looking at some combination of php and java (heavier on the java side to allow for the automatic refresh of the form).

 
use window.opener() method of javascript.

e.g. in popup:
<script>
window.opener.document.MainPageForm.MainPageText.value="ASD"
</script>

the abive will set the value of a field called MainPageText to "ASD" in the main page / parent page...


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top