duanpang5583 2017-05-25 13:16
浏览 27

X-cart表单字段在模糊事件中变空

I'm using X-cart 5 and trying to create a new form following this tutorial from X-cart's website. I have successfully created the form and it is displayed correctly. However, if I specify field type that is not X-cart's (for instance if I use Symfony\Component\Form\Extension\Core\Type\PasswordType), the field is emptied on blur.

Sample code generating the form, in which email and passwords have the issue I described, while the sample field is working correctly:

 protected function defineFields()
{

    $schema = [
        self::SECTION_DEFAULT => [
            'email'         => [
                'label'       => static::t('E-mail'),
                'required'    => true,
                'type'        => 'Symfony\Component\Form\Extension\Core\Type\EmailType',
                'position'    => 100
            ],
            'password'         => [
                'label'       => static::t('Password'),
                'type'        => 'Symfony\Component\Form\Extension\Core\Type\PasswordType',
                'required'    => true,
                'position'    => 100,
            ],
            'password_conf'         => [
                'label'       => static::t('Confirm password'),
                'type'        => 'Symfony\Component\Form\Extension\Core\Type\PasswordType',
                'required'    => true,
                'position'    => 100
            ],
            'sampleField'         => [
                'label'       => static::t('Sample field'),
                'type'        => 'XLite\View\FormModel\Type\TextareaAdvancedType',
                'position'    => 100
            ]
        ]
    ];

    return $schema;
}

Do you have any ideas why this happens?

Thanks!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度