Skip to main content
added 27 characters in body
Source Link

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?

I have a HTML form 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?

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?

improved formatting
Source Link
nmr
  • 4.5k
  • 2
  • 17
  • 25

I have a htmlHTML form 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""valid" into the "message" field
  • if void returns the word "failed""failed" into the "message" field

scriptScript 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_metaupdate_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?

I have a html form 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?

I have a HTML form 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?

added 8 characters in body
Source Link

I have a html form 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?

I have a html form 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?

I have a html form 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?

added 31 characters in body
Source Link
Loading
added 26 characters in body
Source Link
Loading
Source Link
Loading