我已经在 google 上进行了搜索,结果空手而归,因为我找到的所有答案由于某种原因对我不起作用,也许有人可以查看我的代码:
<html>
<head>
<meta charset="utf-8">
<title>jQuery Adapter — CKEditor Sample</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script src="ckeditor.js"></script>
<script src="adapters/jquery.js"></script>
<script src="jquery.form.js"></script>
<script>
CKEDITOR.disableAutoInline = true;
$( document ).ready( function() {
$( '#editor1' ).ckeditor(); // Use CKEDITOR.replace() if element is <textarea>.
$( '#editable' ).ckeditor(); // Use CKEDITOR.inline().
} );
function setValue() {
$( '#editor1' ).val( $( 'input#val' ).val() );
}
</script>
</head>
<body>
<form id="f1" action="some.php" method="post" enctype="multipart/form-data">
<table>
<tr>
<td>Title:</td>
<td><input type="text" name="articletitle" id="articletitle" required/></td>
</tr>
<tr>
<td>Featured Image:</td>
<td><input name="MAX_FILE_SIZE" value="2097152" type="hidden">
<input name="image" id="image" type="file" required/></td>
</tr>
<tr>
<td colspan="3"><textarea cols="80" id="editor1" name="editor1" rows="10"></textarea></td>
</tr>
<tr>
<td><input id="save" type="submit" value="Save"></td>
<td><button id="reset">RESET</button></td>
</tr>
</table>
</form>
<script type="text/javascript">
$(document).ready(function(){
var options = {
success: function(){
//$("#articletitle").val("");
alert('HELLO');
}
};
$('#f1').ajaxForm(options);
//$("#button").click(function(){
// $('#f1').clearForm();
// alert("Successfully Added Record");
//});
});
</script>
</body>
</html>
我只希望我的用户收到警报,以便他们知道他们的表单已提交。