php - pulling variable into the data of AJAX post function -
i have below function phone call , trying pull value of variable info data: section of function. have gotten far no such luck getting work. in php using $_post['test'] seek pull value.
thanks
function fnc() { var obutton = document.getelementbyid("adddata"); var info = document.getelementbyid("datainput"); var display = document.getelementbyid("display"); display.innerhtml += "<a id='dispchk'>"+ data.value +"</a>" +"<br />" ; } $.ajax({ type: "post", url: "chkinpost.php?eventid=<?php echo $_get['eventid']; ?>&eventname=<?php echo $_get['eventname']; ?>", data: "test="+ data.value });
either don't utilize function fnc()
:
var obutton = document.getelementbyid("adddata"); var info = document.getelementbyid("datainput"); var display = document.getelementbyid("display"); display.innerhtml += "<a id='dispchk'>"+ data.value +"</a>" +"<br />" ; $.ajax({ type: "post", url: "chkinpost.php?eventid=<?php echo $_get['eventid']; ?>&eventname=<?php echo $_get['eventname']; ?>", data: "test="+ data.value });
or move ajax request function fnc()
:
function fnc() { var obutton = document.getelementbyid("adddata"); var info = document.getelementbyid("datainput"); var display = document.getelementbyid("display"); display.innerhtml += "<a id='dispchk'>"+ data.value +"</a>" +"<br />" ; $.ajax({ type: "post", url: "chkinpost.php?eventid=<?php echo $_get['eventid']; ?>&eventname=<?php echo $_get['eventname']; ?>", data: "test="+ data.value }); }
php javascript ajax post
No comments:
Post a Comment