在一个页面上,我将有一个带有一个表单的bootstrap模式,这个表单不需要一次性填充.
当用户点击模态上的关闭按钮时,是否有一种方法可以使用确认关闭并取消关闭的警告弹出窗口?
我知道这可能看起来很愚蠢,但我无法相互检查2个值.以下代码我多次使用它们并且它们可以工作,但在一个实例中它只是做了奇怪的事情.在头版我得到:
<input type=\"text\" name=\"v571\" id=\"v571\" value=\"\" size=\"18\"/>
<input type=\"hidden\" name=\"v571a\" id=\"v571a\" value=\"140\"/>
Run Code Online (Sandbox Code Playgroud)
在js脚本中我有:
if( $('#v571').val() > $('#v571a').val()) {
$('#v571').addClass('error');
error++;
}
Run Code Online (Sandbox Code Playgroud)
这些是结果:
if v571 betweem 100 and 140 -> no error (should get no error)
if v571 less then 100 -> error (should get an error)
if v571 bigger then 140 -> error (should get an error)
if v571 bigger then 140 , but the number starts with 1 (eg: 1000, 1200, 12312, 1xxx...) -> no error (should get an …Run Code Online (Sandbox Code Playgroud)