• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[SOLVED] how to set the value of a hidden field in a form

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] how to set the value of a hidden field in a form

    I've done this numerous times, so I guess this is my friday the 13th present. I can't see what I'm doing wrong

    Code:
    //controller code
    var myhiddenfield = this.getMyForm().down('#myhiddenfield');
    if(myhiddenfield){
       console.log(this.currentRecord.get('FIELD'));  //<---good value.
       myhiddenfield.setValue(this.currentRecord.get('FIELD');
       console.log(myhiddenfield)  //<---no value..
    }
    
    
    //form snippet
    buidlItems: function(){
      return [{
          xtype: 'hidden',
          name: myhidenfield,
          itemId: 'myhiddenfield
    }]
    }

  • #2
    Thanks to the expert team at Valence, problem solved. There actually was nothing wrong with the above code. The problem was that my var parms = this.getMyForm().getForm().getValues(); was being done before the hidden fields were loaded.

    a bug duh for me!

    Comment

    Working...
    X