I have a HTML form embedded within a PHP file with an onclick button which summons a javascript function.
<form name="addStamp">
Validation Code:<br>
<input type="number" name="inputcode"><br>
<input type="text" name="message" id="message"><br>
<input type="button" name="submitbutton" value="Submit" onClick="stampme()">
</form>
The function looks at the entry in "inputcode" field and:
- if valid returns the word "valid" into the "message" field
- if void returns the word "failed" into the "message" field
Script snippet that populates the form:
document.addStamp.message.value = msg;
document.addStamp.inputcode.value = "";
} else if (document.addStamp.inputcode.value != test) {
document.addStamp.message.value = msg2;
}
What I can't figure out is now how to bring the result back into php so I can use it to perform a update_user_meta
task.
All of the above happens without refreshing the page and I need to get the result of the javascript function back into php without refreshing the page also.
Any help please?