简体   繁体   中英

Email form detail in Sencha Touch giving exception

I have a form in my page. I want the form details, which are filled by user, to send on a particular email.

Here is my Form:

 xtype: 'formpanel',
            width: 300,
            height: 900,//recommended for the build
            url: 'contact.php',
            scrollable:false,
            items:[
                    {
                        xtype: 'textfield',
                        name : 'name',
                        label: 'Name',
                        labelWidth:100
                    },
                    {
                        xtype: 'textfield',
                        name : 'Date of birth',
                        label: 'Date of birth',
                        maxLength: 10,
                        labelWidth:120
                    },
                    {
                        xtype: 'textfield',
                        name : 'Nationality',
                        label: 'Nationality',
                        labelWidth:100
                    },
                    {
                        xtype: 'textfield',
                        name : 'City of Residence',
                        label: 'City of Residence',
                        labelWidth:170
                    },
                    {
                        xtype: 'textfield',
                        name : 'Country',
                        label: 'Country',
                        labelWidth:100
                    },                  
                    {
                        xtype: 'textfield',
                        name : 'Date',
                        label: 'Starting date of this course',
                        labelWidth:220
                    },
                    {
                        xtype: 'fieldset',
                        title: '3. Course to join',
                        items: [
                            {
                                xtype: 'selectfield',
                                label: 'Choose one',
                                labelWidth:120,
                                options: [
                                    {text: 'Ayurveda Massage (Ayurveda Yoga Massage)',  value: 'first'},
                                    {text: 'Ayur Balance Massage', value: 'second'},
                                    {text: 'Abhyanga Massage with Shirodhara',  value: 'third'}
                                ]
                            }
                        ]
                    },
                    {
                        xtype: 'numberfield',
                        name : 'Date',
                        label: 'Starting date of this course',
                        labelWidth:220
                    },
                    {
                        xtype: 'numberfield',
                        name : 'Your Phone',
                        label: 'Your Phone',
                        labelWidth:120
                    },
                    {
                        xtype: 'toolbar',
                        items: [
                            {
                                xtype: 'button',
                                height: 30,
                                text: 'Submit',
                                ui      : 'confirm',
                                handler : function(button) {
                                    this.up('formpanel').submit();
                                }
                            }
                        ]
                    }
                ]

Here is my php script:

<?php
// Configuration Settings
$SendFrom =    "Form Feedback <jainishan@yahoo.in>";
$SendTo =      "ishan.fzd@gmail.com";
$SubjectLine = "Feedback Submission";


// Send E-Mail and Direct Browser to Confirmation Page
mail($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom");
?>

On tap of form button, I am getting a following exception:

You're trying to decode an invalid JSON String:
: syntax error, unexpected '.=' (T_CONCAT_EQUAL) in on line :语法错误,第行的出现意外的'。='(T_CONCAT_EQUAL)

Note: "I am facing problem while sending email. I am not even able to send a basic email."

Any help would be greatful.

Thanks Ishan jain

Instead of submitting it directly you can use form's getValues() method to get form data and then format it as per your convenience. Look at this example : http://try.sencha.com/touch/2.0.1/demos/Ext.form.FormPanel.getValues/viewer.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM