function onclickfunc() {
var CPRID = document.getElementById("CPRform");
$.ajax({
type: "POST",
url: "html5-webcam-save.php",
data: {
userid: CPRID
}
});
}
When trying to parse in and send the information collected in the "form" on button click, i get this error:
All I am really trying to do here is to send the information gathered, to my PHP document.
any ideas?
function onclickfunc() {
var CPRID = document.getElementById("CPRform");
$.ajax({
type: "POST",
url: "html5-webcam-save.php",
data: {
userid: CPRID
}
});
}
When trying to parse in and send the information collected in the "form" on button click, i get this error:
All I am really trying to do here is to send the information gathered, to my PHP document.
any ideas?
Share asked Oct 4, 2016 at 14:32 Mathias Rønnow NørtoftMathias Rønnow Nørtoft 80310 silver badges29 bronze badges 3-
6
perhaps
var CPRID = document.getElementById("CPRform").value;
because as it stands,CPRID
is a DOM element, and you can't pass that off as data – Jaromanda X Commented Oct 4, 2016 at 14:33 - This because you are trying to send HTML element as request data – MysterX Commented Oct 4, 2016 at 14:33
- Already asked here stackoverflow./questions/6095530/… – Kapil Yadav Commented Oct 4, 2016 at 14:33
3 Answers
Reset to default 3What a rookie mistake, forgetting the .value
function onclickfunc() {
var CPRID = document.getElementById("CPRform").value;
$.ajax({
type: "POST",
url: "html5-webcam-save.php",
data: {
userid: CPRID
}
});
}
Check the passed values.
var CPRID = document.getElementById("CPRform").value;
above will solve the problem.
In my case Its e due a variable typo error in variable POST Variable.
Please Check for that also.
CPR_ID -> CPRID