is this the write way of creating a form in the parent window of a popup and submitting the parent window form from popup.

1.
2. function copy(){
3. var elem=opener.document.createElement("form");
4. elem.setAttribute("name","form1");
5. elem.setAttribute("id","form1");
6. elem.setAttribute("action","searchdata.action");
7. opener.document.appendChild(elem);
8.
9. var inp=opener.document.createElement("input");
10. elem.setAttribute("name","work1");
11. elem.setAttribute("id","work1");
12. elem.setAttribute("value","");
13. opener.document.getElementById("form1").appendChild(inp);
14.
15. opener.document.getElementById("work1").value=opener.document.getElementById("workID").value;
16. }
17.
18.

function copy(){ var elem=opener.document.createElement("form"); elem.setAttribute("name","form1"); elem.setAttribute("id","form1"); elem.setAttribute("action","searchdata.action"); opener.document.appendChild(elem); var inp=opener.document.createElement("input"); elem.setAttribute("name","work1"); elem.setAttribute("id","work1"); elem.setAttribute("value",""); opener.document.getElementById("form1").appendChild(inp); opener.document.getElementById("work1").value=opener.document.getElementById("workID").value; }



and onclick of a submit button...i am doing



1.
2. function closing(){
3. opener.document.form1.submit();
4. window.close();
5. }
6.


Please help me.