i have this which works well but want to change it to a jQuery version
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style.css" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="tinyeditor.js"></script>
</head>
<body>
<form id="bodyText" method="POST" action="confirmText.php">
<textarea id="descText" name="input" style="width:400px; height:200px"></textarea>
<input class="bodyTextBtn" type="submit" value="confirm text" onclick='my_instance.post()'/>
</form>
<script type="text/javascript">
var my_instance = new TINY.editor.edit('editor',{
id:'descText',
width:730,
height:400,
cssclass:'te',
controlclass:'tecontrol',
rowclass:'teheader',
dividerclass:'tedivider',
controls:['bold','italic','underline','strikethrough'],
footer:true,
fonts:['Verdana','Arial','Georgia','Trebuchet MS'],
xhtml:true,
cssfile:'style.css',
bodyid:'editor',
footerclass:'tefooter',
toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggle'},
resize:{cssclass:'resize'}
});
</script>
</body>
</html>
so i would have to change those areas in highlight to
Code:
<form id="bodyText" method="POST" action="">
<input class="bodyTextBtn" type="submit" value="confirm text"/>
and my jQuery code which doesnt work at the moment
Code:
$("#bodyText").submit(function() {
var $form = $(this),
dText = $form.find( 'body[id="editor"]' ).val();
$.post( 'confirmText.php?', {descText:dText}, function( data ) {
//call back
});
return false;
});
confirmText.php
Code:
<?
$bar = $_POST['input'];
?>
Bookmarks