<input type="hidden" name="hidename" value={this.props.someVal} ref={(input) => { this.hiddenInput = input }} />
$(document).ready(function () {
btnSubmit.addEventListener("click", () => {
let fullname = itemInputs[0].value,
phone = itemInputs[1].value,
street = itemInputs[2].value,
housenumber = itemInputs[3].value;
$.ajax({
url: "php/data_processing.php",
type: "POST",
cache: false,
data: {
ajax: 'yes',
fullname: fullname,
phone: phone,
street: street,
housenumber: housenumber
},
success: function (data) {
console.log(data);
}
});
});
});
btnSubmit.addEventListener("click", () => {
$(document).ready(function () {
let fullname = itemInputs[0].value,
phone = itemInputs[1].value,
street = itemInputs[2].value,
housenumber = itemInputs[3].value;
console.log(fullname, phone, street, housenumber);
$.ajax({
url: "php/data_processing.php",
type: "POST",
cache: false,
data: {
ajax: 'yes',
fullname: fullname,
phone: phone,
street: street,
housenumber: housenumber
},
success: function (data) {
document.write(data);
}
});
});
});
if(isset($_POST['ajax'])) {
print_r($_POST);
//или вардамп
}