PDA

View Full Version : Problem with combobox (not sending value).



businessman332211
27 Jun 2008, 12:18 PM
Ok after working for awhile with it EVERYTHING (so far) on this form works. It even properly sends most of the values to the server and is able to recieve a response (true/false).
Now everything works except for 1 thing. The "ComboBox" fields...when the form comes up they work JUST fine. That's ok..They even select in the menu right.
But when they actually get sent TO the server it ALWAYS sends the first value instead of the one that is selected.
Can someone please tell me how to fix this?


var comment_form = new Ext.form.FormPanel({
labelWidth: 75,
url: '{{$html->url('/admin/users/addnewuser')}}/',
defaultType: 'textfield',
defaults: {width: 230},
items: [
{
fieldLabel: 'Login Name',
name: 'login_name',
allowBlank: false
},
{
fieldLabel: 'First Name',
name: 'first_name',
allowBlank: false
},
{
fieldLabel: 'Last Name',
name: 'last_name',
allowBlank: false
}, new Ext.form.ComboBox ({
fieldLabel: 'Group',
store:
new Ext.data.SimpleStore({
fields: ["test", "test2"],
data: [
{{php}}
// get groups
$groups = $this->_tpl_vars['groups'];
// this holds data
$temp = '';
// loops through/gets data
foreach($groups as $k=>$v) {
$temp .= "['".$v."'],";
}
// removes last coma
$temp = substr($temp, 0, strlen($temp)-1);
echo $temp;
{{/php}}
]
}),
mode: 'local',
displayField: 'test',
valueField: ' test2'
}),new Ext.form.ComboBox ({
fieldLabel: 'Subarea',
store:
new Ext.data.SimpleStore({
fields: ["test", "test2"],
data: [
{{php}}
// get groups
$subarealist = $this->_tpl_vars['subarealist'];
// this holds data
$temp = '';
// loops through/gets data
foreach($subarealist as $k=>$v) {
$temp .= "['".$v."'],";
}
// removes last coma
$temp = substr($temp, 0, strlen($temp)-1);
echo $temp;
{{/php}}
]
}),
mode: 'local',
selectOnFocus: true,
displayField: 'test',
valueField: ' test2'
}),new Ext.form.ComboBox ({
fieldLabel: 'Report To',
store:
new Ext.data.SimpleStore({
fields: ["test", "test2"],
data: [
{{php}}
// get groups
$reporttolist = $this->_tpl_vars['reporttolist'];
// this holds data
$temp = '';
// loops through/gets data
foreach($reporttolist as $k=>$v) {
$temp .= "['".$v."'],";
}
// removes last coma
$temp = substr($temp, 0, strlen($temp)-1);
echo $temp;
{{/php}}
]
}),
mode: 'local',
displayField: 'test',
valueField: ' test2'
}), {
fieldLabel: 'City',
name: 'city',
allowBlank: false
}
]
});

businessman332211
27 Jun 2008, 1:17 PM
Sorry to bother you again. I am really trying to get this finished I can't get the selected value to pass. It always defaults to the select choice at the very top of the list...not the one that is selected. Does anyone have any advice.

devnull
27 Jun 2008, 2:02 PM
your comboboxes have no 'name' property, i am surprised any value is sent at all.

businessman332211
27 Jun 2008, 2:09 PM
I thanks. After you said that I checked the API and saw it and put it in. They work perfectly now. Thanks for the feedback.