Fix for check bug when key for Ueditor's select control is empty

Source: Internet
Author: User

  In the workflow form, the drop-down box control will appear as follows because of the Ueditor editor

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5C/91/wKioL1Ud6qGDBKfOAABugp1yl0M481.jpg "title=" Select0 (04-03-09-13-46). png "alt=" wkiol1ud6qgdbkfoaabugp1yl0m481.jpg "/>

When the value of the first drop-down item: When no content is entered, the generated select source code is as follows:

<select style= "width:80px;height:25px;" ><option> Please select </option><option value= "M" > Male </option><option value= "F" > Female </option ></select>

In this case, after the select control has the "required" property set, the Custom-valid.js function, the value of the default check that gets to is "Please select",

Because there is a value, the " required " check passes, but this does not achieve business purposes.

Modified Ueditor Source code of Custom-valid.js, in the original 127 line added

else if (element.is ("select")) {var option = $ (Element). Find ("option:selected"); value = $.trim ($ (option). val ());}

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5C/91/wKioL1Ud6yKRza4JAACPWFlwe6Y365.jpg "title=" Select1 (04-03-09-13-46). png "alt=" wkiol1ud6ykrza4jaacpwflwe6y365.jpg "/>

  The generated select source code is as follows:

<select style= "width:80px;height:25px;" ><option value= "" > Please select </option><option value= "M" > Male </option><option value= "F" > Female </option></select>

When the value of the first option is entered "" (a space string), when the Custom-valid.js file is checked, the value of the option that is selected by default is "" (an empty string), and the required check does not pass, thus achieving the business purpose.


This article is from the "South Lake Miner Technology Space" blog, please be sure to keep this source http://jncumter.blog.51cto.com/812546/1627894

Fix for check bug when key for Ueditor's select control is empty

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.