I have an array in PHP and I have an input field, I was wondering how to get my value in the input field into the array?
array(
"message"=>$_POST['test'],
"others"=>"blah"
)
<input type="text" id="putIntoArray" >
<a href="#" onclick="jqueryPOST(this.value);">Post</a>
function jqueryPOST(value){
var message = $("#putIntoArray").val();
//I dont know how to put this value into "message" array?
}
So with the Post link, it should take the input value into the array “message”, but not sure how to? would this also be the best way?
Thanks!
like in your case – DEMO: