PDA

View Full Version : Form is submitting Display Values, not IDs



bbxx
28 Aug 2009, 11:51 AM
var quarterFreqValues = [
[1, 'Three Months'],
[0, '13 Weeks']
];

var quarterFreqField = new Ext.form.ComboBox({
fieldLabel: 'Quarters',
allowBlank: false,
editable: false,
store: new Ext.data.SimpleStore({
fields: ['id', 'quarterFreq'],
data : quarterFreqValues
}),
displayField: 'quarterFreq',
valueField: 'id',
id: 'b3MonPerQtr',
mode: 'local',
triggerAction: 'all',
emptyText:'Quarter Freq...',
selectOnFocus:true
});


On the post, I want to see 0 or 1, but I am seeing "Three Months" or "13 Weeks". What am I doing wrong?

tubamanu
28 Aug 2009, 12:04 PM
actually i do not know how to post the value instead of the text from your combo.....

in case of php, u can use array_keys....

can be something like this..



$data = array_keys($_REQUEST);

bbxx
28 Aug 2009, 1:13 PM
Yeah, that is one way. I was just hoping there would be a more direct method.


actually i do not know how to post the value instead of the text from your combo.....

in case of php, u can use array_keys....

can be something like this..



$data = array_keys($_REQUEST);

madkris
28 Aug 2009, 3:44 PM
try.


hiddenName : 'id',

bbxx
28 Aug 2009, 4:20 PM
try.


hiddenName : 'id',


Thanks, that led me in the right direction. Actually instead of :

hiddenName : 'id',

I put:

hiddenName : 'b4MonPerQtrID',

This way in php I can read the value like:


$bPayLastDayMonth = $_POST['b3MonPerQtrID'];