Jqueryweui Custom dialog box-with TEXTAREA

Source: Internet
Author: User

Jqueryweui

There are many types of dialogs available in Jqueryweui, which you can visit to see.
Today's record is a dialog box with a text field defined by itself, so that some information can be submitted without reversing the page. For example, send a message and send a reply.

Official web We can see that there is a dialog box with an input box:

$.prompt ("Custom Message content",function(text) {//Click on the callback function after confirmation  //text is what the user enters},function() {  //Click the Cancel callback function});//If there are too many arguments, it is recommended to pass in object$.prompt ({title:Title, Text:' Content copywriting ', Input:' Input box default value ', Empty:false,//whether to allow emptyOnOK:function(input) {//Click to confirm}, OnCancel:function () {    //Click Cancel  }});

We can see the parameters provided are still very rich, but not what we need, so we first run this example, observe the changes on the page, we can find the control of the input box ID, we know, the bottom line must be based on this ID to control the other operations, So here we can secretly change the input box to textarea, so that the success of the bottom, the completion of the rescue.

 $.prompt ("Entry Message", function   ( Text) {Changeorderstatus ( ", text); //  related processing, the input of the content Ajax to the background processing }, function   () {$.closeprompt ();  //  Close the dialog box     }); $ ( "#weui-prompt-input"). Remove (); //  Remove the original input box  $ (". Weui_dialog_bd"). Append (' <textarea rows= ' 8 "type=" height:110px ; "class=" Weui_input weui-prompt-input "id=" Weui-prompt-input "value=" "></textarea>" );  //  re-stitching should be textarea.  

The above class and ID can not be replaced by other Oh, if the future version has changed, you need to follow the above method, you can observe, and then replace it.
Finally, it shows:

Jqueryweui Custom dialog box-with TEXTAREA

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.