Last active
August 29, 2015 14:25
-
-
Save sam452/737bdf0990b1af0ef203 to your computer and use it in GitHub Desktop.
pass output of js function into PHP form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="post" action="confirmation.php" name="donationForm" id="donationForm" onsubmit="return validateAmount();"> | |
<input type="hidden" id= | |
"my-frequency" name="frequency" value= | |
<?php echo '<script type="text/javascript"> myLastFrequency(); </script>'; ?> | |
/> | |
<button class="new-look-select-color new-look-submit-btn" data-pointer-submit="true" name="sbmit" type="submit" value="Submit">SUBMIT | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myLastFrequency() { | |
lastFrequency = document.getElementsByClassName('active btn btn-frequency-custom'); | |
if (lastFrequency.length == 1) { | |
return lastFrequency[0].getAttribute('data-freq'); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment