2

when click boo button, open showmodeldialoge and check some row in showmodeldialoge when press foo button can not get value from child page and pass to parent page

parent page code:

function explain() {
//newwin = window.open('domain.do?method=showBranchForm','newwin');

var a='domain.do?method=showBranchForm';
window.showModalDialog(a, self, 'status:no;resizable:yes;help:no;scroll:yes;width:1300;height:600');

}


<input <%=branchEnable%> class="btn"
style="width: 120px" value="boo" type="button"
onclick="explain();" />

child value should be shown here:

<select id="listbranch"
multiple="multiple" size="8" name="listbranch"
style="width: 200px; font-family: tahoma; font-size: 16"/>

here is the child page:

<script language="javascript" type="text/javascript">
    function TransferData() 
    {
       opener.window.document.forms[0].elements['listbranch'].length=0;
       counter=0;
        document.forms.newform.elements
        for(i=0; i<document.forms[0].elements.length; i++)
        {
        if(document.forms[0].elements[i].type=="checkbox")
        {
            if(document.forms[0].elements[i].checked==true)
        {
            opener.window.addOption(document.forms[0].elements[i].value,document.forms[0].elements[i].id,counter); 
            counter++;
        }
        }
  }
 window.close();
}
</script>





 <tbody>
                                    <%
                                        if(branchsIterator != null){
                                            while(branchsIterator.hasNext()){
                                            Branch t = branchsIterator.next();
                                    %>
                                        <tr>
                                            <td><input type="checkbox"  id="<%=t.getBranchCode()%>"  value="<%=t.getBranchName() %>"/></td>
                                            <td ><%=t.getBranchName() %></td>
                                            <td><%=t.getBranchCode() %></td>
                                        </tr>
                                        <%} 
                                        }
                                        %>
                                    </tbody>


<input class="btn" type="button" value="اfoo" style="width:200px" onclick="TransferData();" />
roland duff
  • 91
  • 1
  • 1
  • 7

0 Answers0