PDA

View Full Version : Form Fails to show in IE7 and IE6



werdnareid
10 May 2007, 10:05 PM
Hi all , have been looking for a post similar to my own problem, but theres just too much to go through so here i am posting. I have a form that works fine in FF and failes to show in IE7 and IE6. The listing for the form is below.........



Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';

var contactform = new Ext.form.Form({
labelWidth: 100, // label settings here cascade unless overridden
url:'test.py',
modal:true,
reader : new Ext.data.XmlReader({ record : 'contactform', success: '@success' },
['first', 'last', 'company', 'email','phone','comment'])
});
contactform.add(
new Ext.form.TextField({fieldLabel: 'First Name', name: 'first',width:200,allowBlank:false
}),
new Ext.form.TextField({ fieldLabel: 'Last Name',name: 'last',width:200, allowBlank:false
}),
new Ext.form.TextField({fieldLabel: 'Company', name: 'company',width:200
}),
new Ext.form.TextField({fieldLabel: 'Email',name: 'email',vtype:'email',width:200,allowBlank:false
}),
new Ext.form.TextField({fieldLabel: 'Phone#', name: 'phone', vtype:'phone', width:200
}),
new Ext.form.TextArea({ fieldLabel: 'Comments', name: 'comment',width:300,height:200
})
);
contactform.addButton('Save',function(){
if (contactform.isValid()) {
Ext.MessageBox.alert('Success', 'You have filled out the form correctly.');
}else{
Ext.MessageBox.alert('Errors', 'Please fix the errors noted.');
}
}, contactform);
contactform.addButton('Cancel',function(){
contactform.on('click',contactform.reset())
});
contactform.render('form-ct');
});

tryanDLS
11 May 2007, 6:29 AM
Please post your code in 'code' tags so people can read it. This seems to render fine in IE6 as long as you put it in a container div that wide enough e.g. 500px

jsakalos
11 May 2007, 11:14 AM
Sorry, no answer to your question, just clarification of Tim's post. HTML to html tags:



<div id="example1"></div>
and code to code or event better to php tags:



var a = function() {
// ...
}

werdnareid
11 May 2007, 11:46 AM
Ok thanks both of you. unfortunately i am one of those JS people who try to use the examples.
and so i simply edit the examples, most of what is in there i dont understand and so i tend to get into spots like this....in any case i know that i should have a number of <div> to serve as the heading, body, footer etc of the form. so i hope i simply just need to change one of the div names

jsakalos
11 May 2007, 12:15 PM
unfortunately i am one of those JS people who try to use the examples.Why unfortunately ;) Using examples and adjusting 'em to your needs is best way to learn. Plus doc, of course.

Good luck.

werdnareid
11 May 2007, 12:27 PM
OK here is the change i made to the div. unfortunatly it just got worse. now it wont show in FF or IE



div style="width:500px;">
<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
<h3 style="margin-bottom:5px;">Simple Form</h3>
<div id="myForm"></div> </div></div></div>