user1216398
user1216398

Reputation: 1960

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?

Upvotes: 0

Views: 1375

Answers (2)

andep
andep

Reputation: 8163

For input field: Ext.get('binfo').dom.value = value

Upvotes: 1

dbrin
dbrin

Reputation: 15673

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 :)

Upvotes: 2

Related Questions