A page instantiates two ueditor editors, but the same birth has a different destiny.

Source: Internet
Author: User

Today, there is a strange problem, there is a project need to display two Ueditor editor on the same page, in the presentation without any problems, but when the "save" button is wrong, there is one of the ueditor in ASP. NET can not get the value of the editor, then the code is this:

First Ueditor <script type= "Text/plain" id= "Editorvalue" ><asp:literal id= "ltlcontent" runat= "Server" > </asp:literal></script>//second Ueditor<script type= "Text/plain" id= "Editorcontact" ><asp: Literal id= "ltlcontact" runat= "Server" ></asp:literal></script>//instantiate <script type= "text/ JavaScript ">          var UE = new UE.ui.Editor ({});          var uecontact = new UE.ui.Editor ({});          Ue.render (' Editorvalue ');             Uecontact.render (' editorcontact ');    </script>        

The result is that editorcontact the content of this editor cannot be retrieved by request.params["Editorcontact", but the first ueditor is normal, why? Code is the same, but the name is not the same is the same birth has a different fate?

~~~~~

I'm trying to change the name of the ID. The problem is still unable to get the content of the editor, finally I added a property in the second editor ueditor the problem is solved. :(

The way is:

Add the Name property to the second Baidu editor

Final code:

The first <script type= "Text/plain" id= "Editorvalue" ><asp:literal id= "ltlcontent" runat= "Server" without the Name property > </asp:literal></script>//the second ueditor<script with the name attribute type= "Text/plain" id= "Editorcontact" Name= " Editorcontact "><asp:literal id=" ltlcontact "runat=" Server ></asp:Literal></script>

Actually in the code world also has such unfair treatment, really confused AH ~ ~ ~

----------------

Original link: http://www.cnblogs.com/samlin/p/editor_without_name_attribute.html

@ Small Promotion--->

At the same time you can view the author's recent project Eight Claw fish Bidding network we give you a lot of advice oh:)

One page instantiates two ueditor editors, but the same birth has a different destiny

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.