大家好,在tipswindown中,我点击提交。不管newsetid中有没有值。都会弹出“set号不为空”,然后会提交成功。
但是如果我把 addnewsetID div中的display:none去掉,不在tipswindown中操作,直接在div中点击提交,就会正常判断是否提交,是否为空。
同时,我在写别的函数,也发现不能获取tipswindown中控件的正确值。郁闷。请各位高手帮我看看问题所在,谢 谢
代码如下:$(document).ready(function() {
    $("#addnewset").click(function() {
            tipsWindown("添加新SET","id:addnewsetID","300","150","true","","true","text");
    });
});
function checkset()
{
    var seten=document.getElementById("newsetId");
    if(seten.value=="")
    {
        alert("set号不能为空");
        seten.focus();
        return false;
    }
    return true;
}
<div id="addnewsetID" style="display:none;">
    <table width="95%" border="1"  bordercolor="#2372B1" style="font-size:13px;font-family:'微软雅黑'; border-collapse:collapse;">
        <form name="newsetform" method="post" action="/route/addset/">
        <tr>
            <th align="right">SET号:</th>
            <th align="left"><input type="text" value="" id="newsetId" name="newset"></th><span id="nameTip"></span>
        </tr>
        <tr>
            <td align="right">选择IDC:</td>
            <td align="left" >
            {% for i in allidc %}
            {% if forloop.counter|divisibleby:3 %}
            <input type="checkbox" name="newidc" value ="{{ i.idc }}">{{ i.idcname }}&nbsp;&nbsp;&nbsp;&nbsp;<br>
            {% else %}
            <input type="checkbox" name="newidc" value ="{{ i.idc }}">{{ i.idcname }}&nbsp;&nbsp;&nbsp;&nbsp;
            {% endif %}
            {% endfor %}
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center"><input type="submit" id="mysubmit" name="Submit" value="提交" onclick="return checkset()">
            </td>
        </tr>
        </form>
    </table>
</div>