我希望能够通过按一个按钮打开OSX样式对话框简单模式,但前提是表单的其余部分已经填写完毕。现在,我首先给它一个osx demo类
<input type='button' name='osx' value='Create Coupons' onClick = 'startModal();' class='osx demo'/> 我想让它在onClick函数中启动
function startModal() {
if (daily) {
createDailyModal();
} else {
createFullModal();
}
if($('#enddate').val().indexOf("/") != -1){
*code to start modal*
}
}有没有办法可以做到这一点?谢谢你的帮忙!
发布于 2013-07-17 19:06:44
首先,我会避免在你的html中使用onClick。为什么?在jquery脚本中完成这一部分会更清晰。
<input type='button' name='osx' value='Create Coupons' class='osx demo'/>那就这么做
$("[name='osx']").click(function()
{
if($('#enddate').val().indexOf("/") != -1)
{
*code to start modal*
}
});https://stackoverflow.com/questions/17678201
复制相似问题