PDA

View Full Version : [SOLVED] Form Submit Internet Explorer : not passing on post vars



RazeWork
13 Nov 2009, 6:28 AM
Hi All,
I'm been banging my head against this all morning and am beginning to doubt my sanity. The Following code creates a form inside a tab window, everything works fine in both opera and firefox, however in internet explorer 7 the form doesn't seem to be passing on the $_POST variable to the php script... any help at all would be greatly welcomed.


form = new Ext.form.FormPanel({
frame:true,
width: 600,
height: 600,
defaults: {width: 230},
defaultType: 'textfield',
items: [
{
fieldLabel: 'TO',
name: 'message[rcpt_id]',
allowBlank:false
},
{
fieldLabel: 'Subject',
name: 'message[subject]',
allowBlank:false
},{
fieldLabel:'Message',
name: 'message[text]',
height:300,
anchor:'98%'
}
],
buttons: [
{
text: 'Save',
type: 'submit',
handler: function() {
form.form.submit({
url: 'http://web12.trafford.ac.uk/intranet/live/messages_send.php',
success: function() {
Ext.MessageBox.alert('Message', 'Message Sent');
},
failure: function(form, action) {
Ext.MessageBox.alert('Message', 'Sending Failed');
}
});
}
},{
text: 'Cancel',
handler: function() { form_user.form.reset(); }
}
]
})



I've put up a working example of the problem here: http://web12.trafford.ac.uk/intranet/live/problem.php

Below is the contents of messages_send.php



if(!isset($_POST['message'])) {
print('{success:false}');
exit();
}
print('{success:true}');


Thanks in advance

13 Nov 2009, 9:08 AM
I get an exception: "uncaught exception: No center region defined in BorderLayout ext-comp-1007" in your code - could it be that this is causing your form not to properly build in IE?

That said, I've *never* seen this problem. I suggest you clean up your code, get the UI layout working and then try again.

RazeWork
13 Nov 2009, 11:35 AM
Fixed the unhandled exception problem, I'd not added region: 'center' on the form :">

I've just tested it now in IE6 and it seems to be working, but can't test with IE 7 from my current location :( so i can't flag this as solved.

Thisis an example of what i'm trying to do, the form itself sits inside a larger application. I'm hoping to be honest this hasn't been the problem in this case as this won't fix the larger application, which afaik there are no layout issues.

Anymore suggestions are welcome :D

RazeWork
16 Nov 2009, 7:00 AM
Well after a hell of a lot of digging I've found extjs is not at Fault. The Problem is in-fact Internet Explorer craziness (IE really doesn't behave how you expect the vast majority of the time).

When the browser expects to wow-authenticate to a page it doesn't send the POST to save bandwidth. More details can be found on the problem here:

http://blogs.msdn.com/david.wang/archive/2005/12/01/HTTP-POST-Fails-for-Anonymous-Authentication.aspx

Seriously Guys SSO is a lot of trouble in the long run! :((

aktolman
1 Dec 2009, 5:02 AM
Hi Peeps,

Im having a similar problem. In fire fox. No post fields are being passed to event.php but the page is being called.

Any ideas as to what im doing wrong?



/**
* postForm
*/
this.postAdd = function ()
{
// its a column, we have to ask for some input
layoutWindow = new Ext.Window({
title: "Insert form details",
closeAction: "hide",
modal: true,
resizeable: false,
items: [
new Ext.FormPanel({
id: "addForm",
border: false,
bodyBorder: false,
bodyStyle: "padding: 10px",
items: [
{
width: 200,
labelWidth: 100,
xtype: "textfield",
fieldLabel: "Form name",
name: "formName"
}
,
{
width: 200,
labelWidth: 100,
xtype: "textarea",
fieldLabel: "Form description",
name: "formName"
}
,
{
xtype: "hidden",
name: "formDefinition",
value: document.getElementById(this.outputItem).innerHTML
}
,
{
xtype: "hidden",
name: "event",
value: "formDesignerSaveForm"
}
,
{
xtype: "hidden",
name: "encode",
value: "json"
}
]
})
],
buttons: [{
text: 'Insert',
handler: function()
{
// check the form
var form = Ext.getCmp("addForm").getForm();
if(form.isValid())
{
// post what we have
form.submit({
waitMsg:"Loading...",
method: "post",
url: "event.php",
success: function(form,action)
{
console.log("form:", form);
console.log("action:", action);
},
failure: function(form,action)
{
Ext.MessageBox.alert("Failure", "There was a problem saving your form");
}
});
}
layoutWindow.destroy();
}
,scope: this
},
{
text: 'Cancel',
handler: function()
{
layoutWindow.destroy();
}
,scope: this
}]
});
layoutWindow.show();
}