PDA

View Full Version : Something wrong with my code, please help!



mosiami
7 Apr 2008, 1:48 AM
I have searched topics and tried many ways, but it still doesn't work, please help, Thanks!

my html code (test.html)


<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />

<!-- GC -->
<!-- LIBS -->
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<!-- ENDLIBS -->

<script type="text/javascript" src="../../ext-all.js"></script>

<script>
Ext.onReady(function(){
var form = new Ext.FormPanel({
method : 'POST',
url: 'save-test.php',
defaultType: 'textfield',
baseCls: 'x-plain',
buttonAlign: 'center',
labelAlign: 'EXT_FORM_LABEL_HALIGN_LEFT',
labelWidth: 55,
items: [{
anchor: '100%',
xtype: 'textfield',
name: 'to',
fieldLabel: 'Send To'
},{
anchor: '100%',
xtype: 'textfield',
name: 'subject',
fieldLabel: 'Subject'
},{
anchor: '100% -53',
xtype: 'textfield',
name: 'msg',
hideLabel: true}]
});
var window = new Ext.Window({
height: 300,
width: 500,
items: form,
layout: 'fit',
bodyStyle: 'padding:5px',
buttonAlign: 'EXT_FORM_LABEL_HALIGN_CENTER',
title: 'Resize Me',
buttons: [{
xtype: 'button',
text: 'Send',
handler: function(){
form.getForm().submit({
method:'POST'
}); }
},{
xtype: 'button',
text: 'Cancel',
handler: function() {
form.getForm().reset(); }
}],
minHeight: 200,
minWidth: 300,
plain: true
});
window.show();
});

</script>

my php code (save-test.php)


<?
echo "To:".$_POST['to']."---<br>";
echo "Subject:".$_POST['subject']."---<br>";
echo "Msg:".$_POST['msg']."---<br>";
?>


everytime I click send button, it always have error <row:24 column:1513 must have ')' >
I don't know why!!!

mjlecomte
7 Apr 2008, 6:43 AM
Are you using firebug?

Are you using ext-all-debug.js during development?

If you answer yes to both then the error reported is more descriptive to help you find the problem.

Check the learn section of this site for FAQs and check the debug section for tips on debugging.

mosiami
8 Apr 2008, 2:40 AM
Could anybody just give me some hint or answer, I am almost going crazy:((

rudytheng
8 Apr 2008, 2:45 AM
hi....

i dont get what you're talking clearly... but i think ext.formpanel expected the return in json result.... ( i always do this way and never found any problem? )

by the way... it is important to know do you use firebugs?

mjlecomte
8 Apr 2008, 4:42 AM
Post the error that firebug tells you. The error you show in your first point is of no use. No one can help you using that error.

mosiami
8 Apr 2008, 5:11 PM
I try to input some chars on my form and click the send button.
Seems the form received the value I input but still got an error.
Attach file is the error from firebug, please help.
Thanks!