Before testing the page function, we found that when you press the Enter key in the input field of input type = "text", the form will be automatically submitted, then, the submit button is changed from the submit type to the button type.
This solves the problem of automatic form submission, but leads to a new problem, that is, the nicedit Value in the form cannot be submitted.
See this article during Google's ProcessArticle(Nicedit cannot get textarea value under jquery) an inspiration is that you can read the content in the nicedit Rich Text Editor in JS and assign the content to textarea, then, submit the form.CodeIs:
< 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 = "Certificate ('{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.