Solution: jsp cannot submit content in nicEdit

Source: Internet
Author: User

In the google process, I saw this article ("NicEdit cannot get textarea value under JQuery") Get an inspiration, that is, I can use js to read the content in the nicEdit Rich Text Editor, grant the content to textarea and then submit the form. Code:

Copy codeThe Code is as follows: <textarea name = "intro" rows = "15" cols = "30" id = "introContent" style = "width: 750px; height: 300px; border: 1px solid #000; ">$ {sightInfo. introduction} </textarea>
<Input type = "button" value = "submit" onclick = "button ('{introcontent'{.val('.nicedit-main'{.html (); $ ('form'). submit ();"/>

('{Introcontent'{.val({('.nicedit-main'{.html ());

This Code ensures that the content in nicEdit is assigned to the textarea element before the form is submitted. In this way, the value of "intro" will not be blank when the servlet is read.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.