Checking a checkbox in Opener from a Popup 
Author Message
 Checking a checkbox in Opener from a Popup

Hi folks,

How can you change to value of a checkbox (in a parent window) from a
popUp...Here's what I'm doing so far.

I open the popup using a text link, calling my PopWin function.

The Function:
#############
function popWin(url,name,w,h,scrol,loc,stat) {
newWin=window.open(url,name,"width="+ w + ",height=" + h + ",scrollbars=" +
scrol + ",location=" + loc + ",status=" + stat);
 }
#############

Text Link and call to function:
###############
<A
HREF="javascript:popWin('myPopup.asp?ITEM=123456','pics',475,350,1,0,1)">Det
ails</a>
##############

The window pops and I want to offer users an opportunity to view the page,
then click a button that will check the checkbox in the Opener window...or
close the window.

Do This:
<input type="submit" value="Add Item to Order" onClick ="AddItem()">
Or This:
<a href="javascript:window.close();">Close Window</a>

Here's "AddItem":

<SCRIPT LANGUAGE="JavaScript">
<!--
function AddItem() {
 alert("This Item ...123456...is Being Added to Your Order...or it will be
added once I can reference the form in the parent window.")
 window.opener.document.form.123456.value = true;
 window.close();
 }
-->
</script>

Any help would be greatly appreciated



Sat, 17 May 2003 03:00:00 GMT  
 Checking a checkbox in Opener from a Popup
Hi

Don't use only numbers as id's

window.opener.document.forms.FORMNAME.CHECKBOXNAME.checked = true;

--
Best Regards
  Vidar Petursson
 ==============================
   Microsoft Internet, Client, SDK MVP
 ==============================
 http://www.icysoft.com
 http://www.dna.is



 ==============================
  No matter where you go there you are
 ==============================


Quote:
> Hi folks,

> How can you change to value of a checkbox (in a parent window) from a
> popUp...Here's what I'm doing so far.

> I open the popup using a text link, calling my PopWin function.

> The Function:
> #############
> function popWin(url,name,w,h,scrol,loc,stat) {
> newWin=window.open(url,name,"width="+ w + ",height=" + h + ",scrollbars="
+
> scrol + ",location=" + loc + ",status=" + stat);
>  }
> #############

> Text Link and call to function:
> ###############
> <A

HREF="javascript:popWin('myPopup.asp?ITEM=123456','pics',475,350,1,0,1)">Det

- Show quoted text -

Quote:
> ails</a>
> ##############

> The window pops and I want to offer users an opportunity to view the page,
> then click a button that will check the checkbox in the Opener window...or
> close the window.

> Do This:
> <input type="submit" value="Add Item to Order" onClick ="AddItem()">
> Or This:
> <a href="javascript:window.close();">Close Window</a>

> Here's "AddItem":

> <SCRIPT LANGUAGE="JavaScript">
> <!--
> function AddItem() {
>  alert("This Item ...123456...is Being Added to Your Order...or it will be
> added once I can reference the form in the parent window.")
>  window.opener.document.form.123456.value = true;
>  window.close();
>  }
> -->
> </script>

> Any help would be greatly appreciated



Sun, 18 May 2003 03:00:00 GMT  
 Checking a checkbox in Opener from a Popup
Outstanding!   Many thanks for your help.

Steve


Quote:
> Hi

> Don't use only numbers as id's

> window.opener.document.forms.FORMNAME.CHECKBOXNAME.checked = true;

> --
> Best Regards
>   Vidar Petursson
>  ==============================
>    Microsoft Internet, Client, SDK MVP
>  ==============================
>  http://www.icysoft.com
>  http://www.dna.is



>  ==============================
>   No matter where you go there you are
>  ==============================



> > Hi folks,

> > How can you change to value of a checkbox (in a parent window) from a
> > popUp...Here's what I'm doing so far.

> > I open the popup using a text link, calling my PopWin function.

> > The Function:
> > #############
> > function popWin(url,name,w,h,scrol,loc,stat) {
> > newWin=window.open(url,name,"width="+ w + ",height=" + h +
",scrollbars="
> +
> > scrol + ",location=" + loc + ",status=" + stat);
> >  }
> > #############

> > Text Link and call to function:
> > ###############
> > <A

HREF="javascript:popWin('myPopup.asp?ITEM=123456','pics',475,350,1,0,1)">Det

- Show quoted text -

Quote:
> > ails</a>
> > ##############

> > The window pops and I want to offer users an opportunity to view the
page,
> > then click a button that will check the checkbox in the Opener
window...or
> > close the window.

> > Do This:
> > <input type="submit" value="Add Item to Order" onClick ="AddItem()">
> > Or This:
> > <a href="javascript:window.close();">Close Window</a>

> > Here's "AddItem":

> > <SCRIPT LANGUAGE="JavaScript">
> > <!--
> > function AddItem() {
> >  alert("This Item ...123456...is Being Added to Your Order...or it will
be
> > added once I can reference the form in the parent window.")
> >  window.opener.document.form.123456.value = true;
> >  window.close();
> >  }
> > -->
> > </script>

> > Any help would be greatly appreciated



Mon, 19 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Checking what checkboxes are checked

2. Bug in an interaktion between a popup and opener window

3. Interaktion zwischen popup und opener window

4. Checking for existence of opener

5. Checking to see if opener window exists

6. how to force user to check on checkbox on client side

7. checkbox check populates hidden field

8. checkbox checked values in IE (ie5)

9. how do i determine when a checkbox is checked

10. Requesting only the checked checkboxes on resulting page?

11. Automate checking of web page checkbox

12. Checkbox check

 

 
Powered by phpBB® Forum Software