Page 1 of 1

how to run php in modal window

Posted: Tue Apr 21, 2015 10:23 pm
by elmira_k82
Hi,

Is there any way to run php code on modal window?
I already have my php code working for iframe object and now trying to bind it with custom button click for html object,
I need run something like this inside html object

<script type="text/javascript">
function openiFrame(phpCode){
var w = new nuWindow();
w.call_type = 'nurunphp';
w.php = phpCode; // already have this code in php procedures
nuSession.nuWindows.push(w);
nuIframeWindow(w);
}
</script>
<input type="button" value="TestingButtonClick " onclick="openiFrame('drawPieGraph')" class="nuButton" />


Thanks.

Re: how to run php in modal window

Posted: Thu Apr 23, 2015 12:57 am
by admin
elmira_k82,

I don't understand. You need to explain your question a lot more, maybe incude pictures.

My guess is you are not using nuBuilderPro to do what you need, the way it should be (which is likely much simpler).

Steven.

Re: how to run php in modal window

Posted: Thu Apr 23, 2015 12:02 pm
by elmira_k82
Hi Steven,

I have buttons generated as html object like (btns.png)

And also have php codes drawing google charts (chartCode.png)

After click to buttons I'm trying to generate different charts inside pupup which I already have in php codes.

Re: how to run php in modal window

Posted: Thu Apr 23, 2015 12:13 pm
by elmira_k82
also for botton clicks nuRunPHP() works fine only code generated outside as a new tab

<input type="button" class="nuButton" value="Patients By Gender" onclick="nuRunPHP('graphPatGender')" />

Re: how to run php in modal window

Posted: Fri Apr 24, 2015 1:49 am
by admin
elmira_k82,

Let me see if I understand...

Do you want a different graph to appear inside the iFrame that already exists, when you click on a button?

If so, add the id (Field Name) as a second parameter to nuRunPHP() eg. nuRunPHP('graphPatGender', 'graph_iframe')

http://wiki.nubuilder.net/index.php/Jav ... C_id.5D.29

Secondly if you create nuBuilderPro Button Objects instead of hardcoding html to make buttons. You can drag them where ever you want them and add onclick Events that will call nuRunPHP().

http://wiki.nubuilder.net/index.php/Add ... Button_Tab

Steven