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 <[email protected]>";
$SendTo =      "[email protected]";
$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:
Parse error: syntax error, unexpected '.=' (T_CONCAT_EQUAL) in E:\softwares\Sencha dwnlds\xampp\htdocs\RasovaiApp\contact.php on line 11

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

Answers:

Answer

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

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.