Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

how to run php in modal window

Post Reply
elmira_k82
Posts: 7
Joined: Sun Mar 01, 2015 8:35 pm

how to run php in modal window

Unread post 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.
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: how to run php in modal window

Unread post 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.
elmira_k82
Posts: 7
Joined: Sun Mar 01, 2015 8:35 pm

Re: how to run php in modal window

Unread post 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.
Attachments
btns.png
btns.png (100.88 KiB) Viewed 3540 times
chartCode.png
chartCode.png (47.81 KiB) Viewed 3540 times
elmira_k82
Posts: 7
Joined: Sun Mar 01, 2015 8:35 pm

Re: how to run php in modal window

Unread post 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')" />
Attachments
nuRunPHP.png
nuRunPHP.png (42.42 KiB) Viewed 3540 times
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: how to run php in modal window

Unread post 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
Post Reply