我正在使用以下代码来验证证书字段。
var x = document.forms["myForm"]["obs"].value;
if (x == null || x == "") {
alert("All the fields are mandatory..");
return false;
}
我尝试用带有两个按钮的模式替换alrt动作:返回字段并将其留空
尝试斑马对话框。这是非常有用的插件。http://stefangabos.ro/jquery/zebra-dialog/
var x = document.forms["myForm"]["obs"].value;
if (x == null || x == "") {
$.Zebra_Dialog('All the fields are mandatory..', {
'type': 'question',
'title': 'Custom buttons',
'buttons': ['Return To field', 'Leave Empty'],
});
return false;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句