Ideas:Use the method to get the reference to the pop-up subform, and then use ="***" on the subpage to return the result.
Sample code: (simplified implementation with jQuery)
Parent page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:///TR/xhtml1/DTD/"> <html xmlns="http:///1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Parent page</title> <mce:script language="javascript"><!-- function showmodal() { var strReturn = ("",null,"dialogWidth:800px;dialogHeight:600px;help:no;status:no"); var s="You have chosen:"; for(var i=0;i<;i++) { s+=strReturn[i]+","; } alert(s); } // --></mce:script> </body> </html>
Subpage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:///TR/xhtml1/DTD/"> <html xmlns="http:///1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Subform</title> <mce:script type="text/javascript" src="jquery-1.4." mce_src="jquery-1.4."></mce:script> <mce:script type="text/javascript"><!-- var result; $(function(){ $("#send").click(function(){ var result=new Array(); $("[name=a]:checkbox:checked").each(function(){ ($(this).val()); }); =result; (); }); }); // --></mce:script> </head> <body> <p> <input type="checkbox" name="a" value="apple" />apple <input type="checkbox" name="a" value="tangerine" />tangerine <input type="checkbox" name="a" value="banana" />banana <INPUT type="button" value="submit" /> </p> </body> </html>
Summarize:
Parameter passing:
1. If you want to pass parameters in the dialog box, it is passed through vArguments. There is no restriction on type, for string types, the maximum is 4096 characters. Objects can also be passed, for example:
-------------------------------
<script> var obj = new Object(); ="51js"; ("",obj,"dialogWidth=200px;dialogHeight=100px"); </script>
<script> var obj = alert("The parameter you passed is:" + ) </script>
2. You can return information to the window where the dialog box is opened, and of course it can also be an object. For example:
<script> str =("",,"dialogWidth=200px;dialogHeight=100px"); alert(str); </script>
<script> ="/a497785609"; </script>
Extensions:
In .net, AJAX effects can be achieved in this way. When the child page passes the parameters to be selected, the parent page can implementICallbackEventHandlerThe interface directly passes the obtained value back to the server. Or useUpdatePanel's Load eventTo catch the passed parameters, continue to process the server side.
The above implementation code of JavaScript pop-up child form and returning the result to the parent form is all the content I have shared with you. I hope you can give you a reference and I hope you can support me more.