Hybrid View
-
4 Mar 2008 8:30 AM #1
Empty POST submit
Empty POST submit
Hi.
I am constructing a form using HTML and then applying the javascript to it. (although, this problem also happens ramdomlly in another application where the form is constructed using Extjs)
In the submit i have something like:
All the items exist, but when i see in Firebug, the POST is being sent empty.Code:if (form_prof.isValid()) { form_prof.submit({ params:{ nome: prof_nome.getValue(), sexo: prof_sexo.getValue(), BI: prof_BI.getValue(), dataNasc: prof_data_nasc.getValue(), tel: prof_tel.getValue(), morada: prof_morada.getValue(), codigo_postal: prof_codigo_postalA.getValue()+"-"+prof_codigo_postalB.getValue(), localidade: prof_localidade.getValue(), mail: prof_mail.getValue(), IVA: prof_IVA.getValue(), IRS: prof_IRS.getValue(), numero_cap: prof_numero_cap.getValue(), curriculum_vitae: prof_curriculo.getValue(), _1_1: MDom.getValue(), _1_2: MSeg.getValue(), _1_3: MTer.getValue(), _1_4: MQua.getValue(), _1_5: MQui.getValue(), _1_6: MSex.getValue(), _1_7: MSab.getValue(), _2_1: TDom.getValue(), _2_2: TSeg.getValue(), _2_3: TTer.getValue(), _2_4: TQua.getValue(), _2_5: TQui.getValue(), _2_6: TSex.getValue(), _2_7: TSab.getValue(), _3_1: PDom.getValue(), _3_2: PSeg.getValue(), _3_3: PTer.getValue(), _3_4: PQua.getValue(), _3_5: PQui.getValue(), _3_6: PSex.getValue(), _3_7: PSab.getValue(), formacoes: jsondata }, waitMsg:'Processando...', failure: function(form, action) { Ext.MessageBox.alert('Erro', action.result.msg); }, success: function(form, action) { Ext.MessageBox.alert('Mensagem', action.result.msg); } }); }else{ Ext.Msg.alert('Erros', 'Verifique todas as caixas marcadas.'); }
I have used the PHP print_r($_POST) command and the array is empty.
Does anyone have any idea of what is happening ?
I'm really lost on this...
-
4 Mar 2008 9:19 AM #2
If firebug shows post is empty, php will certainly show it's empty.
Why not spit out what params is and check it in the console? Or set a break point and check it.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
4 Mar 2008 9:33 AM #3
I put an alert before the submit with some content that should be sent in the POST, and the value shown is correct.
The POST is still sent empty.
-
4 Mar 2008 9:45 AM #4
Some does not equal all correct?
What does console log show?Code:params={ nome: prof_nome.getValue(), sexo: prof_sexo.getValue(), BI: prof_BI.getValue(), dataNasc: prof_data_nasc.getValue(), tel: prof_tel.getValue(), morada: prof_morada.getValue(), codigo_postal: prof_codigo_postalA.getValue()+"-"+prof_codigo_postalB.getValue(), localidade: prof_localidade.getValue(), mail: prof_mail.getValue(), IVA: prof_IVA.getValue(), IRS: prof_IRS.getValue(), numero_cap: prof_numero_cap.getValue(), curriculum_vitae: prof_curriculo.getValue(), _1_1: MDom.getValue(), _1_2: MSeg.getValue(), _1_3: MTer.getValue(), _1_4: MQua.getValue(), _1_5: MQui.getValue(), _1_6: MSex.getValue(), _1_7: MSab.getValue(), _2_1: TDom.getValue(), _2_2: TSeg.getValue(), _2_3: TTer.getValue(), _2_4: TQua.getValue(), _2_5: TQui.getValue(), _2_6: TSex.getValue(), _2_7: TSab.getValue(), _3_1: PDom.getValue(), _3_2: PSeg.getValue(), _3_3: PTer.getValue(), _3_4: PQua.getValue(), _3_5: PQui.getValue(), _3_6: PSex.getValue(), _3_7: PSab.getValue(), formacoes: jsondata }; console.log('params = ',params); form_prof.submit({ params:{params},
Did you try adding listeners to proxy and ajax requests?MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
5 Mar 2008 2:40 AM #5
i added the params to the console, and they are ok.
the POST is still sent empty...
i tested the form definition, and this happens (in this example) when i use "fileUpload: true," in the form definition.
The solution is to use the convencional form submit so i am able to send a file with it...
PS: i still would like to solve this, because this is happening randomly in another form that doesn't send any file...


Reply With Quote