在Symfony 2表单中使用jquery-addresspicker [英] Using jquery-addresspicker in a Symfony 2 form

查看:83
本文介绍了在Symfony 2表单中使用jquery-addresspicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Symfony 2插件 jquery-addresspicker 表单收集选定的经度/纬度。虽然填充了lng / lat字段,但在提交表单后,出现以下错误:

  SQLSTATE [23000]:完整性约束冲突:1048字段lat不能为空(null)

这是我的表单的一部分: p>

 < label> Lat:< / label> 
{{form_widget(form.lat,{attr:{'disabled':'disabled'}})}}< br />
< label> Lng:< / label>
{{form_widget(form.lng,{attr:{'disabled':'disabled'}})}}< br />

在表单字段中

I'm using the plugin jquery-addresspicker with a Symfony 2 form to collect the selected longitude/latitude. Although the lng/lat fields are populated, after the form is submitted I get the following error:

SQLSTATE[23000]: Integrity constraint violation: 1048 Field lat cannot be empty (null)

Here is part of my form:

<label>Lat:</label> 
{{form_widget(form.lat, {attr: {'disabled':'disabled'}})}} <br/>
<label>Lng:</label> 
{{form_widget(form.lng, {attr: {'disabled':'disabled'}})}} <br/>

解决方案

I just needed to remove the attribute in "desabled" defined in the form field

这篇关于在Symfony 2表单中使用jquery-addresspicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
PHP最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆