2
<input type="hidden" name="test" value="test"/>

i want using ko get value of input. my component

define([
    'Magento_Ui/js/form/form',
    'jquery',
    'jquery/ui'
], function(Component) {
    'use strict';
    return Component.extend({
        initialize: function () {
            this._super();
            // component initialization logic
            return this;
        }
    });
});
2
  • You should use data-bind to get value in html
    – aravind
    Commented Jun 25, 2019 at 4:49
  • <input type="hidden" id="test2" data-bind="value: yourValue()"/>
    – aravind
    Commented Jun 25, 2019 at 4:50

1 Answer 1

1

Try below code

<input type="hidden" id="test" name="test"  data-bind="value: test">

Review https://mage2.pro/t/topic/597

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.