1

I have value in knouckout js i am trying to pass it on controller or observer. what should i do? anyone can help me.

getSelectedValuecc: function() {
            /* jQuery(document).on("click", ".cusbtn", function (event) {
                if (!jQuery('input[name="payment[method_wallet]"]').is(':checked')) {
                var msg = "Please select any one options";
                    jQuery("#ccavneue_mssg").show();
                return false;
                }
                var radioValue = jQuery("input[name='payment[method_wallet]']:checked").val();
                //alert(radioValue);
                if(radioValue == 'paytm'){
                        jQuery("#ccavneue_mssg").hide();
                           jQuery("#cust_paytm").click(); 
                }
                if(radioValue == 'mobikwikwallet'){
                             jQuery("#ccavneue_mssg").hide();
                            jQuery("#submob").click(); 
                }
            });*/
            jQuery(function () {
            jQuery("#paytm_payment_profile_id").change(function () {
            //alert('select chnage');
            var selectedValue = jQuery(this).val();
            //jQuery('input[name="payment[method]"]').attr("disabled",true);
            if (selectedValue !=''){
               jQuery("#pay").show();
               jQuery("#address").show();
            }else{
                jQuery("#pay").hide();
                jQuery("#address").hide();
            }
            alert("Value: " + selectedValue);
            if(selectedValue == 'vsquare'){
               jQuery("#address").html("V Square Building 1st Lane, DwarakaNagar,Visakhapatnam-530016,AP.,India").show();
               jQuery("#paytm").click();
               return false;
            }
            if(selectedValue == 'pavanpalace'){
               jQuery("#address").html("A-1,Pavan Palace,near telugu thalli Flyover,Station Road, Dwaraka Nagar,Visakhapatnam-530016,AP.,India").show();
               jQuery("#paytm").click();
               return false;
            }
        });
    });
        //});,
    },

call this value on html

<select name="payment[method]" class="select input-text required-entry" 
                            data-bind="
                                attr: {id: getCode()+'_payment_profile_id'},
                                event:{ change: getSelectedValuecc()},
                                options: getCardList(),
                                optionsValue: 'value',
                                optionsText: 'type',
                                optionsCaption: $t('--Select Store--'),

                                ">
         </select>

now i am looking for pass selectedvalue in save order before observer to save this value in table.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.