1
votes

First off, thanks for your patience I'm pretty new to Ext. All I'm trying to do is get the value of a hidden form field on an HTML page and store its value a variable inside an ext script. Here's what I'm working with: HTML PAGE:

<form name="myForm">
<input type="hidden" id="accountID" name="divAccountID" value="463">
</form>

Ext Page:

var myAccountID = Ext.ComponentQuery.query('panel[name=myForm] #accountID');
3

3 Answers

3
votes

This is most suitable:

var hidden = Ext.getCmp('accountID');
var hiddenValue = hidden.getValue();
2
votes
    var win = Ext.widget('nameofviev');  

//The above line will find the view in which we want to find the hidden fields 

    win.down('hidden#row_id').setValue(index);

//The above line set the value of hidden field that's `id` is `row_id`.
//If we remove the `#row_id` it find first hidden field and set value of that

// or

var hidden = Ext.getCmp('accountID');
var hiddenValue = hidden.getValue();
1
votes

You can get the value like that:

var v = Ext.get('accountID').dom.value;

Check this example: Jsfiddle