简体   繁体   中英

Unable to set a input field with ExtJS

I have a onChange event that should trigger the update of an input field. Here is my code:

HTML:

<select id="builds" onchange="setBuild()">
    <option value="select">Select</option>
    ...
</select>


<input type="text" id="buildInfo" name="buildInfo" style="margin-top:10px;" value=""/>

ExtJS:

function setBuild(){

    var value = Ext.get("builds").dom.options[Ext.get("builds").dom.selectedIndex].text;

    Ext.get("buildInfo").update(value);
}

I've verified that I'm passing a valid value but I'm still unable to update the value for my input element. Any idea what I'm missing?

Update method is typically used to replace inner html of the element. perhaps you can just set the value of the buildInfo element by Ext.get("buildInfo").value = value .

Honestly though I have never seen extjs used in this way :)

对于输入字段:Ext.get('binfo')。dom.value = value

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM