【问题标题】:Email form detail in Sencha Touch giving exceptionSencha Touch 中的电子邮件表单详细信息给出异常
【发布时间】:2014-05-07 23:14:36
【问题描述】:

我的页面中有一个表单。我希望用户填写的表单详细信息通过特定电子邮件发送。

这是我的表格:

 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();
                                }
                            }
                        ]
                    }
                ]

这是我的 php 脚本:

<?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");
?>

点击表单按钮,我收到以下异常:

您正在尝试解码无效的 JSON 字符串:
解析错误:语法错误,E:\softwares\Sencha dwnlds\ 中出现意外的 '.=' (T_CONCAT_EQUAL) xampp\htdocs\RasovaiApp\contact.php 上线 11

注意:“我在发送电子邮件时遇到问题。我什至无法发送基本电子邮件。”

任何帮助都会很棒。

谢谢 伊山耆那教

【问题讨论】:

  • xtype 的值应该是一个对象吗?看不到任何开始 { 或结束 } ..
  • 其实是集成在vbox容器中的Form Panel。我还没有发布全班。这个视图运行得非常好。只有当我点击提交按钮时才会出现异常。

标签: php javascript sencha-touch sencha-touch-2


【解决方案1】:

您可以使用表单的getValues() 方法获取表单数据,然后根据您的方便对其进行格式化,而不是直接提交。看这个例子:http://try.sencha.com/touch/2.0.1/demos/Ext.form.FormPanel.getValues/viewer.html

【讨论】:

  • 感谢您的关注,但先生,我的问题有所不同。我无法使用 php 脚本发送基本电子邮件。请帮助我。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-04-25
  • 1970-01-01
  • 2017-10-28
  • 1970-01-01
  • 2018-07-06
  • 2020-09-14
  • 2011-03-20
相关资源
最近更新 更多