Learn JS, the problem of emptying the text value of the combobox of the pit Daddy

Source: Internet
Author: User

Today is the text value of the ComboBox to empty the problem of abuse, the following into the topic:

Md.drugView.cleanSearch = function () {
s = S1 = "";

Md.drugView.datagrid.datagrid (' Load ', {});//reload the data without reading the data, the value passed to the background is empty
Md.drugView.searchform.find (' input '). Val (');//Find all the input tags under the Searchform form and empty

};

The above is the way to empty the values in all the input tags in the form, so the problem is, when we're done with this method,

The value in input should be emptied, but when we use $ ("#sampleProvince_com"). ComboBox (' GetText ') gets the value of the text literal,

We will find that the value of input is still there, because we are emptying value, not text, in my personal understanding, the text will be buffered by the browser

, so if we just emptied the value of value, to empty the text value, we need to empty the text separately, using the jquery plugin's

The statement can be used in this sentence:

$ ("#sampleProvince_com"). ComboBox (' SetText ', "");

So you just need to add the sentence to solve the problem.

Md.drugView.cleanSearch = function () {
s = S1 = "";
$ ("#sampleProvince_com"). ComboBox (' SetText ', "");
Md.drugView.datagrid.datagrid (' Load ', {});//reload the data without reading the data, the value passed to the background is empty
Md.drugView.searchform.find (' input '). Val (');//Find all the input tags under the Searchform form and empty

};

Learn JS, the problem of emptying the text value of the combobox of the pit Daddy

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.