2013-03-22 45 views
2

我在注册页面中使用占位符。在那个密码和确认密码字段是存在的。如果我们将一些值拖放到密码字段中,则密码字段不是加密的,而是显示值。拖放到“密码和确认密码”字段中的值显示为纯文本

enter image description here

在regForm,

->add('password','password',array('property_path'=>false,'attr'=>array('placeholder'=>'Password'))) 
->add('confirmPassword','password',array('property_path'=>false,'attr'=>array('placeholder'=>'Confirm password'))) 




In twigtemplate, 

{{ form_widget(form.password) }} 

{{ form_widget(form.confirmPassword) }} 





$(function() { 
    // Invoke the plugin 
    $('input, textarea').placeholder(); 
    var html; 
    if (html) { 
    $('<p class="note">' + html + '</p>').insertAfter('form'); 
    } 
    }); 
+2

安置自己的HTML和JavaScript。很难调试你看不到的代码。 – Blender 2013-03-22 05:09:21

+1

检查是否输入类型=“密码”作为什么@dineshkmar说 – BizApps 2013-03-22 05:30:24

+0

它是树枝模板文件和是啊我已经提到了密码字段中的密码类型的密码字段 – pinku 2013-03-22 05:41:21

回答

1

检查你定义的输入字段类型为 “密码”

<input type="password"> 
+0

是啊我已经提到that.I'm使用symfony2和树枝template.Anyway感谢您的帮助。 – pinku 2013-03-22 05:30:07