PDA

View Full Version : ComboBox question ...



AloneWalker
25 Apr 2008, 6:01 AM
Hello all, I have a problem witch combo boxes. I have a form for submitting some data and this form working but combobox values not posted correctly. For example when i select a Class names 1. Class 2. Class etc. This combobox value need to post my url 1,2,3 ...
but my post value is Pre.Class 1. Class etc..

How can i solve this problem ?

Thank you..

Here is My Codes

.....
var classses = [
['0', 'Pre.Class']
,['1', '1. Class']
,['2', '2. class']
,['3', '3. class']
,['4', '4. class']
,['5', '5. class']
,['6', '6. class']
];

var ClassStore = new Ext.data.SimpleStore({ fields: ['classNumber', 'classDescription'],data : classses}); // end Store

var addCourseForm = new Ext.form.FormPanel(
{
.....

, new Ext.form.ComboBox({
fieldLabel : 'Course Classses'
,name:'courseC'
,emptyText:'Please Select a Class'
,selectOnFocus:true
,store : classStore
,displayField:'Description'
,mode: 'local'
,triggerAction: 'all'
,width : 50
})

rvent
25 Apr 2008, 6:28 AM
I dont understand what you are asking...

Please provide an example of the POST you are getting and the POST you want...

Thanks

AloneWalker
25 Apr 2008, 7:28 AM
Sorry my English :)

i'm trying explain again ...

i have a combobox in my Ext.form.FormPanel . i create this combobox dynamically. My form panel working good.But my problem is combobox's post value. Normally html selectboxes return "value" tag value. For Example
....
<select id="myid" name="mySelect">
<option value="1">First </option>
...

</select>
....
when we select "First" option and submit mySelect value = 1.

So i want to POST Ext.form.Combobox "value" tag value.Not displayField value.

when my Ext.form.Formpanel submitting, combobox value return display value but i dont want return
display value. For example when i was select 1.Class option in my combobox it must POST 1
not '1.Class'.

maybe i can explain this problem.. :)

thanks again..

halkon_polako
26 Apr 2008, 8:59 AM
Try defining valueField and hiddenName properties (also check the displayField value):


...
,displayField:'classDescription'
,valueField:'classNumber',
,hiddenName:'courseC'
...

AloneWalker
27 Apr 2008, 9:53 PM
Thanks.... :)
it works perfectly :)