Home  >  Article  >  Web Front-end  >  ArtEditor rich text editor adds form submission function_javascript skills

ArtEditor rich text editor adds form submission function_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:04:591557browse

Summary:

artEditor.js is a mobile rich text editor that supports image uploading, and will add emoticons, short videos and other functions later. Recently, a friend reported whether artEditor supports form submission. Of course, it does. Before this function is developed, you can implement form submission as follows

$('.submit').on('click', function(e) {
e.preventDefault();
$('.hidden').val($('#artEditor').getValue());
$(this).submit();
}); 

New features:

Added formInputId parameter, which represents the id of the hidden field of the form, and will put the editor content into the hidden field, as follows:

<form action="">
<input type="hidden" id="target">
<div id="artEditor">
</div>
</form>
<script>
$('#artEditor').artEditor({
formInputId: 'target'
});
</script>

Related reading:

jQuery mobile artEditor rich text editor

The editor will tell you so much about adding the form submission function to the ArtEditor rich text editor. I hope it will be helpful to you!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn