Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createForm(elem) {
- var myForm2 = new Ext.form.FormPanel({
- renderTo:elem,
- width:425,
- frame:true,
- style:"margin: 10px auto 10px auto;",
- items: [{xtype:'fieldset',
- title: 'Contact Info',
- autoHeight:true,
- items :[new Ext.form.RadioGroup({
- fieldLabel: 'Main Phone',
- vertical: false,
- id:"mainPhone",
- items: [
- {boxLabel: 'Home', name: 'id-1', inputValue: 'H', checked:true},
- {boxLabel: 'Work', name: 'id-1', inputValue: 'W'},
- {boxLabel: 'Other', name: 'id-1', inputValue: 'O'}
- ]
- }),
- new Ext.form.TextField({
- id:"frm_CreateCustomerHomePhone",
- fieldLabel:"Home Phone",
- width:275,
- allowBlank:true
- }),
- new Ext.form.TextField({
- id:"frm_CreateCustomerWorkPhone",
- fieldLabel:"Work Phone",
- width:275,
- allowBlank:true
- })
- new Ext.form.TextField({
- id:"frm_CreateCustomerOtherPhone",
- fieldLabel:"Other Phone",
- width:275,
- allowBlank:true
- })
- ]}]});
- }
- myForm2.getForm().getValues()['id-1'];
- var checkedItem = Ext.getCmp('mainPhone').getValue();
- if (checkedItem == undefined) return '';
- return checkedItem.getGroupValue();
- // The getGroupValue will return the value of the checked option in a group,
- // unfortunately, it only seems to work on the items and not the radiogroup
- // itself
- myForm2.getForm().findField('id-1').getGroupValue();
- Ext.getCmp("mainPhone").items.get(0).getGroupValue();
- var radio = ...;
- var value = radio.inputValue;
- function get_radio_value()
- {
- for( var i=0; i < document.myForm.mainPhone.length; i++ )
- {
- if( document.myForm.mainPhone[ i ].checked )
- {
- return document.myForm.mainPhone[ i ].value;
- }
- }
- }
Add Comment
Please, Sign In to add comment