0

I want a text box in my modal widget in custom js file and get the value of that text box on button click of that modal.

require([
    'jquery',
    'jquery/ui',
    'Magento_Ui/js/modal/modal'
], function($){
        .modal({
            autoOpen: true,
            responsive: true,
            clickableOverlay: false,
            modalClass: 'modal-custom',
            title: 'test',

            // here I want textbox

            buttons: [{
                text: $.mage.__('Return'),
                class: 'return_btn',
                click: function () {

                     //get the value of textbox in variable

                     $(".modal-custom").hide();
                }

            }],

         });
    });

Is there another property for textbox like button which can be used here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.