Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
I have my custom payment method on the checkout page with the dropdown list. and I want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom table. /view/frontend/web/template/payment/custom.html <div class="field field-nu
Source Link

I have my custom payment method on the checkout page with the dropdown list. and I want to get that dropdown selected value in knockout js and forward it to the controller and store the dropdown value in my custom table.

I want to store dropdown selected valuevalues to my custom DB table onat the click of a button using a controller.

I have my custom payment method on the checkout page with the dropdown list. and I want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom table.

I want to store dropdown selected value to my custom DB table on click of button using a controller.

I have my custom payment method on the checkout page with the dropdown list. and I want to get that dropdown selected value in knockout js and forward it to the controller and store the dropdown value in my custom table.

I want to store dropdown selected values to my custom DB table at the click of a button using a controller.

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

iI have my custom payment method inon the checkout page with the dropdown list. and iI want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom table.

I want to store dropdown selected value to my custom dbDB table on click of button using a controller.

i have my custom payment method in checkout page with dropdown list. and i want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom table.

I want to store dropdown selected value to my custom db table on click of button using controller.

I have my custom payment method on the checkout page with the dropdown list. and I want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom table.

I want to store dropdown selected value to my custom DB table on click of button using a controller.

Bumped by Community user
Source Link
Pratik ojha
  • 165
  • 2
  • 11

magento 2 How to get dropdown selected value in knockout js on button click

i have my custom payment method in checkout page with dropdown list. and i want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom table.

/view/frontend/web/template/payment/custom.html

      <div class="field field-number required">
                <label for="credit_days" class="label">
                    <span><!-- ko i18n: 'Click & Collect Credit Days'--><!-- /ko --></span>
                </label>
                <div class="control">
                    <select id="credit_days"
                            class="credit_days"
                           name="credit_days"
                           data-validate="{required:true}"
            onChange="if(this.value=='requestmore'){document.getElementById('request_more').style.display='block';}else{document.getElementById('request_more').style.display='none';}"
                           data-bind="value:creditDaysSelected(), optionsCaption:'Please chose days...'"
                           >
                        <option value="10days">10 Days</option>
                        <option value="20days">20 Days</option>
                        <option value="30days">30 Days</option>
                        <option value="40days">40 Days</option>
                        <option value="requestmore">Request More Days</option>
                    </select>
                </div>
                <div id="request_more" class="request_more" style="display: none">
                    <label for="request_more_credit_days" class="label">
                        <span></span>
                    </label>
                    <div class="control" id="require_more">
                        <input type="text" data-validate="{required:true}" name="request_more_credit_days" id="request_more_credit_days" placeholder="Enter credit Days of your choice" required>
                        <button type="submit" class="button primary action"> <span translate="'Submit Request'"/> </button>
                    </div>
                </div>
            </div>

I want to store dropdown selected value to my custom db table on click of button using controller.

Any help will be appreciated. Thanks in advance