I am using the following html button
<button onclick="ga_cal_change_status(2300)"/>
and I want to call the "my_message" php function from onclick event ga_cal_change_status(2300) passing the value 2300. I am using the following code in functions.php file
<?php
add_action('wp_footer', 'ga_php_cal_change_status');
if( ! function_exists( 'ga_php_cal_change_status' ) ){
function ga_php_cal_change_status($entry_id){
?>
<script>
function ga_cal_change_status($entry_id){
console.log("ga_php_cal_change_status %d", $entry_id);
/* how can I call here the bellow function */
}
</script>
<?php
}
}
function my_message($myid) {
echo $myid;
}
Is there any suggestions how to do this with javascript? Thanks a lot Elias
Post a Comment