jemz — 2013-12-28T03:59:27-05:00 — #1
Hi, I have problem...my php function is not working in the onclick function...why is it not working.can you help me please on this.
var myphpfunc = '<?php echo myfunction();?>';
<a title="Save" onclick="myonclickbutton()" href="#" id="mybtn"><
Thank you in advance
system — 2013-12-28T04:06:47-05:00 — #2
But you should be more specific about what you're trying to accomplish here.
mittineague — 2013-12-28T04:09:52-05:00 — #3
jemz — 2013-12-28T04:43:19-05:00 — #4
Hi,...I want that when i submit the form my php function will be executed in my onclick().
mittineague — 2013-12-28T04:52:03-05:00 — #5
The only way to do that is to send the message to the server, where the PHP function is.
You need either another page load, or to use AJAX. Either way an HTTP request is needed.
system — 2013-12-28T05:17:11-05:00 — #6
jemz — 2013-12-28T05:51:40-05:00 — #7
Ok Thank you...i have some question when i am trying to alert "hello" in my onclick.
var mytest = "<?php echo 'hello';?>";
it will alert to this
<?php echo 'hello';?>
,it should be hello only without the php tags..
jemz — 2013-12-28T06:32:06-05:00 — #8
system — 2013-12-28T07:49:52-05:00 — #9
OK, so it's all about JS?
var mytest = "hello";