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

Popup checkboxes check parent checkboxes

Status
Not open for further replies.

lesleint

IS-IT--Management
Apr 11, 2003
144
US
I have a popup come up if A certain condition is true. Inside this popup there will be a dynamically created list of names with checkboxes and on the parent page there is an identical list. How can I have it so the user can check and uncheck the boxes on the popup and have those actions duplicated to the parent without refreshing the parent?
 
Others correct me if I'm wrong, but I don't think you can do that without refreshing the parent window.
 
Since you could potentially have multiple check boxes with the same name attribute, I'd assign each checkbox on the parent page with a unique id attribute. Then in the popup, use:

<input type=&quot;checkbox&quot; onclick=&quot;opener.document.getElementById(&quot;correspondingParentID&quot;).checked=this.checked&quot;>

Adam
 
yeah do it like adam said but adam i would do away with DOM here and use the document.FormName.CheckBox.checked method. it works in NS also...

Known is handfull, Unknown is worldfull
 
Will try both now, went ahead and made it an ASP thing thing that makes it happen but refreshes the page but I want to do it with JS so thanks for your suggestions
 
Here is a related question: Is it possible to have a different value for the name and id on the same INPUT tag?

For example:
Code:
<INPUT type=&quot;checkbox&quot; name=&quot;parentName&quot; id=&quot;child1&quot; value=&quot;Adam&quot;>Adam
<INPUT type=&quot;checkbox&quot; name=&quot;parentName&quot; id=&quot;child2&quot; value=&quot;Eve&quot;>Eve
You see if this is possible then each element of the document.parentName array could be referenced individually. The checkbox array would still be submitted like a normal checkbox would, but you could enable/disable each individual element with a script. I know that you could use a script and iterate through the array, but this would be easier.

Maybe I am overlooking something obvious, please excuse my ignorance.

Einstein47
(&quot;There are no atheists when restoring from backup.&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top