Created
December 9, 2014 11:59
-
-
Save bran921007/a2b9f8caf0f0124291b3 to your computer and use it in GitHub Desktop.
Passing variable Javascript to PHP
This file contains hidden or 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
<!-- BEGIN HTML--> | |
<form> | |
<div id="textBox" contenteditable="true" name="textBox"><?php echo $storyText; ?> | |
</div> | |
<textarea id="hiddeninput" name="hiddeninput"></textarea> | |
<input type="submit" id="save" name="save" value="Submit"/> | |
</form> | |
<!-- END HTML--> | |
<!-- BEGIN Javascript--> | |
$('#save').click(function () { | |
var mysave = $('#textBox').html(); | |
$('#hiddeninput').val(mysave); | |
$("form:first").submit(); | |
$('#hiddeninput').append(mysave); | |
alert($('#hiddeninput').val()); | |
}); | |
<!-- END Javascript--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment