弹出模态弹出而不是出错时的警报 [英] Make a modal pop up instead of an alert on error

查看:80
本文介绍了弹出模态弹出而不是出错时的警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用谷歌搜索了2天,显然不是问问题的正确方法。我想知道如何在文本框中输入小于25的数值时弹出jquery模式而不是警告,该文本框最小25个顺序告诉最终用户最小订单25。我可以制作模态,我可以发出警报,但我无法弄清楚连接两者的代码。我正在使用jquery-ui。这似乎是一件简单的事情,我不是一个全新的人,但我也不是一个真正的编码器。感谢任何帮助。

谢谢,

Mike

I have googled for 2 days and am obviously not asking the question the correct way. I want to know how to make a jquery modal pop up instead of an alert when I enter a numeric value less than 25 in a text box that is minimum 25 order that tells the enduser "Minimum order 25." I can make the modal and I can make the alert but I can't figure out the code to connect the two. I am using jquery-ui. This seems like a simple thing to do and I am not a total newbie but I am not a real coder either. Grateful for any help.
Thanks,
Mike

推荐答案

你必须创建一个像这样的div :





You will have to create a div like this:



('body')。追加('
< div id =modal_wrapper>
<! - [if IE 6]>
< iframe id =modal_iframe>< / iframe>
<![endif] - >
< div id =modal_overlay>< / div>
< div id =modal_window>
< div id =modal_bar>
模态窗口
< a href =#id =modal_close>关闭< / a>
< / div>
< div id =modal_content>< / div>
< / div>
');
('body').append(' <div id="modal_wrapper"> <!--[if IE 6]> <iframe id="modal_iframe"></iframe> <![endif]--> <div id="modal_overlay"></div> <div id="modal_window"> <div id="modal_bar"> Modal window <a href="#" id="modal_close">Close</a> </div> <div id="modal_content"></div> </div> ');





然后在点击功能中使用它:




Then in a click function use it like:


('myelement')。click(function(){




('myelement').click(function() {



这篇关于弹出模态弹出而不是出错时的警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆