Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

placeholder 影响提交表单的问题 #5

Closed
afc163 opened this issue Jul 23, 2013 · 3 comments
Closed

placeholder 影响提交表单的问题 #5

afc163 opened this issue Jul 23, 2013 · 3 comments

Comments

@afc163
Copy link
Member

afc163 commented Jul 23, 2013

目前 placeholder 由于各类方案的实现问题,仍然沿用目前修改 input 的 value 的方案。

这个方案对于使用原生 submit 方法(对 jQuery.submit 有封装)提交的表单,会把 input 中的默认 placehoder 值提交到后台,从而影响表单数据。

在与 arale/validator 和安全校验的合作中,暂时无法避免使用原生 submit 的方式(因为 validator 使用 jQuery.submit 会引发循环校验,安全校验的提交中默认也是使用原生方法)。所以需要在提交前手动清除 placeholder 所改动的 value 值。

这个地方暂时只能由 placeholder 提供一个静态方法,方便使用者进行调用。

@afc163
Copy link
Member Author

afc163 commented Jul 23, 2013

// 清除对应 input 的 value 值
placeholder.clear(element);

@hotoo
Copy link
Member

hotoo commented Jul 23, 2013

居然是这个结论,我决定让 WebForms2 来拯救你们~

@afc163
Copy link
Member Author

afc163 commented Jul 23, 2013

临时的 ugly 方案,期待 WebForms2 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants