Here is the HTML and the script
<script> $(document).ready(function(){ $(".update_button").click(function(){ var update_post = $("#post").val(); alert('Post is '+ update_post +'.'); return false; }); }); </script> <body> <fieldset style="width:600px; height:550px"> <textarea id="post" class="uiwysiwyg nothing"><?php echo $prvpost; ?></textarea> <input type="submit" value="Post" id="updt_button" class="update_button"/> </fieldset> </body> Note: class="uiwysiwyg nothing" is a script the contains the WYSIWYG commands
But code works:
<body onsubmit="alert('Update: ' + document.getElementById('post').value); return false;"> <fieldset style="width:600px; height:550px"> <textarea id="post" class="uiwysiwyg nothing"><?php echo $prvpost; ?></textarea> <input type="submit" value="Post" id="updt_button" class="update_button"/> </fieldset> </body>