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;
        }
    });
});
  • You should use data-bind to get value in html – aravind Jun 25 '19 at 4:49
  • <input type="hidden" id="test2" data-bind="value: yourValue()"/> – aravind Jun 25 '19 at 4:50
1

Try below code

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

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

|improve this answer|||||

Your Answer

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

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