Mawia HL Mawia HL - 2 months ago 77
Javascript Question

Setting Default value of input textbox in Jquery EasyUI dialog

I have googled and looked throughout the whole documentation and could not figure out why value of input text is not shown. I am using FireFox latest version and below is what I have done so far.

<input name="amount" class="easyui-validatebox" id="d_amount" value="">

In regular html or php page we can give
to set default value, but in EasyUI, it is not possible. So I was thinking possible alternative like below:

var m = '300';

Nothing is shown and I am not getting any error. Any EasyUI expert, please help me.

NOTE: this input field is inside the dialog


I found the answer here. The trick is to use the code inside $(function(){});

    var m=300;
    $('#d_amount').textbox('setValue', m);