I'm just learning javascript and php. I created a contact form and I'd like the submit button to accomplish two things when I press it:
- submit the data to me (this part is working)
- read my onclick function (this part is not working)
<input id="submit" name="submit" type="submit" value="Submit" onclick="eatFood()">
<?php
if ($_POST['submit']) {
////?????
}
?>
I'm sending the data to my email, and so I get that. But the onclick
function doesn't seem to work. I tried reviewing add onclick function for submit button but it didn't help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…