Hi all,
I wanted some help on this scenario...
I have a main browser window. On clicking a hyperlink, i popup a new window. The pop up window has several check boxes and a submit buton.
The user is expected to check some of the boxes and submit.
These checked values need to be populated in a text box in the main window and the popup should close down.
Iam not able to get the checked values in the popup window into the main window check box.
Can somebody gimme some rough code or an approach to get over this...
Rgds
Javascript technique to retrieve checked values...
Moderator: General Moderators
-
gOloVasTicK
- Forum Newbie
- Posts: 2
- Joined: Thu Oct 31, 2002 6:57 am
- Location: Russia, Peterburg
- Contact:
Try this:
In main window:
<a href=your_popup.html target=_blank>ypur_link</a>
<form name=frm>
<input type=text name=txt>
</form>
In popup window:
<form name=popupf>
<input type=checkbox name=chbx1 value=1>
<input type=checkbox name=chbx2 value=2>
<input type=checkbox name=chbx3 value=3>
<input type=button value=submit onClick='for(i=1;i<4;i++){if(eval("popupf.chbx"+i+".checked")){opener.document.frm.txt.value+=eval("popupf.chbx"+i+".value")+";"}};window.close();'>
</form>
Rgdz
In main window:
<a href=your_popup.html target=_blank>ypur_link</a>
<form name=frm>
<input type=text name=txt>
</form>
In popup window:
<form name=popupf>
<input type=checkbox name=chbx1 value=1>
<input type=checkbox name=chbx2 value=2>
<input type=checkbox name=chbx3 value=3>
<input type=button value=submit onClick='for(i=1;i<4;i++){if(eval("popupf.chbx"+i+".checked")){opener.document.frm.txt.value+=eval("popupf.chbx"+i+".value")+";"}};window.close();'>
</form>
Rgdz
-
gOloVasTicK
- Forum Newbie
- Posts: 2
- Joined: Thu Oct 31, 2002 6:57 am
- Location: Russia, Peterburg
- Contact:
If you want get checkboxes values in main window checkbox:
In main window:
<a href=your_popup.html target=_blank>your_link</a>
<form name=frm>
<input type=checkbox name=chbx1>
<input type=checkbox name=chbx2>
<input type=checkbox name=chbx3>
</form>
In popup window:
<form name=popupf>
<input type=checkbox name=chbx1 value=1>
<input type=checkbox name=chbx2 value=2>
<input type=checkbox name=chbx3 value=3>
<input type=button value=submit onClick='for(i=1;i<4;i++){eval("opener.document.frm.chbx"+i+".value=popupf.chbx"+i+".value")}};window.close();'>
</form>
Rgdz
In main window:
<a href=your_popup.html target=_blank>your_link</a>
<form name=frm>
<input type=checkbox name=chbx1>
<input type=checkbox name=chbx2>
<input type=checkbox name=chbx3>
</form>
In popup window:
<form name=popupf>
<input type=checkbox name=chbx1 value=1>
<input type=checkbox name=chbx2 value=2>
<input type=checkbox name=chbx3 value=3>
<input type=button value=submit onClick='for(i=1;i<4;i++){eval("opener.document.frm.chbx"+i+".value=popupf.chbx"+i+".value")}};window.close();'>
</form>
Rgdz