Page 1 of 1

popup with a form

Posted: Mon Sep 05, 2011 4:51 pm
by jacr1102
Hi, I need to create a link to open a popup with a form inside, anybody know how to do it please ?

Re: popup with a form

Posted: Wed Oct 12, 2011 12:04 pm
by alejandra
Hello I command code can help you create popup

var workSchedulePanel;
var workSchedulePanel=function(sWscUid){
if(!sWscUid){
sWscUid = '';
}
workSchedulePanel =new leimnud.module.panel();
workSchedulePanel.options={
size :{w:400,h:150},
position:{x:60,y:60,center:true},
control :{close:true,resize:false},fx:{modal:true},
statusBar:false,
fx :{shadow:false,modal:true}
};
workSchedulePanel.make();
workSchedulePanel.loader.show();
var r = new leimnud.module.rpc.xmlhttp({
url:"workSchedulePanel.php",
method:"POST",
args:"sWscUid="+sWscUid
});
r.callback=function(rpc){
workSchedulePanel.loader.hide();
workSchedulePanel.addContent(rpc.xmlhttp.responseText);
var scs = rpc.xmlhttp.responseText.extractScript();
scs.evalScript();
};
r.make();
};

Re: popup with a form

Posted: Wed Oct 12, 2011 12:17 pm
by liliana
Hi,

Basically you need to create 3 files:

1. The main file, on which your link will appear, on the javascritp section you need to add the following function:
function popupWindow (URL){
window.open('../.../name_file.php', 'mypopup');
}
where:

name_file.php: will be the name of the file on which you will define the name of your form
mypopup: name of your popup window.


You must indicate the path in which your php file is located

Then you need to define a field of link type:

<LINK enableHTML="1" type="link" onClick="popupWindow(this.id);return false;" link="" value="Detalles" hint="" required="0" readonly="0" savelabel="0">
<en>View pop up window</en>
</LINK>

And call the function, defined on the javascript code, on the event onclick.

onClick="popupWindow(this.id);return false

2. Create the file name_file.php with the following code:

<?php

$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', SYS_COLLECTION.'/name_filexml');
G::RenderPage('publish', 'raw');

Where:

name_filexml: will be the name of the form that will appear on the pop window

3. Finally create your XML file that will appear on your popup window

Hope this will be helpful!!