【问题标题】:Display error alert upon form submission提交表单时显示错误警报
【发布时间】:2015-12-02 12:58:58
【问题描述】:

我希望当我提交表单时,如果用户名或密码不正确,那么它应该向我显示警告框。对于警报消息,我使用了 alertify 插件,但它显示的是传统的警报框。我的代码是这样的:

<script type='text/javascript'>
    alert({
        msg: 'Are you sure you want to delete this user',
    });
</script>

但我想要以下输出:

alertmessage

为此我使用了这个:

<script type='text/javascript'>
    alertify.alert({
        msg: 'Are you sure you want to delete this user',
    });
</script>

显示不正确。请帮忙。

【问题讨论】:

  • 你给的东西实际上并没有用。是吗?
  • 是的,当我提交表单时它无法正常工作。

标签: php jquery html forms


【解决方案1】:

查看您正在使用的库的the documentation

alertify.alert(message);

您应该传递一个包含您的消息的 字符串,而不是包含包含该字符串的 msg 属性的对象。

alertify.alert('Are you sure you want to delete this user');

【讨论】:

  • 我已经尝试过您的建议,但仍然无法正常工作。
猜你喜欢
  • 2014-04-13
  • 1970-01-01
  • 1970-01-01
  • 2014-06-25
  • 2010-10-05
  • 1970-01-01
  • 2014-03-13
  • 2020-11-24
  • 1970-01-01
相关资源
最近更新 更多