Submit form in window with toolbar

I have a little problem.

From the parent page I create a Window whit the toolbar. In the window i have a form and in the toolbar I have:

  1. the submit button
  2. the reload button

The problem is that the submit button

[code]dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(true);
dhxWins.setImagePath(“dhtmlx/dhtmlxWindows/codebase/imgs/”);
w1 = dhxWins.createWindow(“w1”, 20, 30, 420, 704);
w1.setText(“Lettera invio proposta”);
w1.attachURL(“Lettera_invio_proposta_prepara.php?CID=<? echo $_GET["CID"]; ?>”);
toolbar = w1.attachToolbar();
toolbar.setIconsPath(“dhtmlx/dhtmlxToolbar/samples/common/imgs/”);
toolbar.addButton(“print”, 7, “Stampa”, “print.gif”, “print_dis.gif”);
toolbar.addSeparator(“sep4”, 12);
toolbar.addButton(“redo”, 7, “Annulla”, “redo.gif”, “redo_dis.gif”);
toolbar.addSeparator(“sep3”, 8);

							   toolbar.attachEvent("onClick", function(id) {
									if(id=="print") 	  {dhxWins.window("w1").reload();}
									if(id=="redo") 		  {window("w1").reload();}
							   });[/code]

I have tried all the possibilities to reload and submit the form, but nothing to do, it didnt work.

Can you help me?

w1.attachURL(“Lettera_invio_proposta_prepara.php?CID=<? echo $_GET["CID"]; ?>”); loads a page into an iframe. So, you should consider this.

OK, but how can I define that the w1 window is the target for the Reload and the form submit?

OK, but how can I define that the w1 window is the target for the Reload and the form submit?

Is the form inside “Lettera_invio_proposta_prepara.php?CID=<? echo $_GET["CID"]; ?>” page ? If it is, this iframe is the target for form.

Lettera_invio_proposta_prepara.php is a php page that is loaded in the dhtmlxWindow, the dhtmlxWindow is not in a Div but is attached to the body of the page.

In the homepage I have a link that open the dhtmlxWindow that contains the php page “Lettera_invio_proposta_prepara.php” that contains a Form.

In the header of the dhtmlxWindow named w1 I have attached the toolbar with 2 options:

  • Print: that creates a PDF document;
  • Cancel: that clear the form.

this 2 actions must be made in the dhtmlxWindow and not in the parent page.

To access iframe, where the page is loaded, you may use getFrame() method.

var winObj = w1.getFrame().contentWindow;

I got that error code:
w1.getFrame is not a function

I use DHTMLX v.2.6 but when I re-download code it works fine.

I got that error code: w1.getFrame is not a function
I use DHTMLX v.2.6 but when I re-download code it works fine.

Yes, the first build of 2.6 version doens’t provide getFrame method. The latest one contains this method.