dongyulan6251 2017-02-23 20:55
浏览 26

HTML / PHP如何在模态中显示错误div元素

I have a login modal with an integrated error message but i don't know how to display it.

Error message:

<div id="loginErrorMsg" class="alert alert-error hide">Wrong username og password</div>

Thanks Jay

  • 写回答

1条回答 默认 最新

  • dongtang2376 2017-02-23 21:16
    关注

    I think that your problem is not PHP, is javascript logic flow that you must do in order to show the error to the user.

    class="alert alert-error hide"
    

    The css class "hide" should hide the error message, then you must remove the "hide" class to display the div, for example with JQuery:

    $('#loginErrorMsg').removeClass('hide')
    

    You can then hide the error message again by re adding the "hide" class. Again for example, with Jquery.

    $('#loginErrorMsg').addClass('hide')
    

    Hopefully now you can see this is a JavaScript problem, not a PHP problem.

    Best regards, Rafael

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?