首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

组合验证

2012-05-28 
求一个组合验证HTML code asp:CheckBoxList IDchklSurfaceChoice RepeatDirectionHorizontal runat

求一个组合验证

HTML code
 <asp:CheckBoxList ID="chklSurfaceChoice" RepeatDirection="Horizontal" runat="server"                                                    CellPadding="3">                                                    <asp:ListItem>HASL</asp:ListItem>                                                    <asp:ListItem>沉金</asp:ListItem>                                                    <asp:ListItem>沉锡</asp:ListItem>                                                    <asp:ListItem>镀金</asp:ListItem>                                                    <asp:ListItem>OSP</asp:ListItem>                                                    <asp:ListItem>沉银</asp:ListItem>                                                    <asp:ListItem>无铅喷锡</asp:ListItem>                                                </asp:CheckBoxList>                                            </td>                                            <td style="width: 100px; text-align: right;">                                                其他:                                            </td>                                            <td>                                                <asp:TextBox ID="txtSurfaceOther" runat="server" Width="120" AutoCompleteType="Disabled"></asp:TextBox>                                            </td>

有一个组合验证,CheckBoxList 任选一项或者TextBox填了东西就算验证通过,这个js怎么写呢?
有一个思路,定义一个字段,如果有写入操作或者选中操作,就把内容写进字段中,然后根据字段判断?但是如果点击了又取消了点击,怎么办呢?

[解决办法]
探讨

引用:

直接判断为不为空。。

那如果点击了2次,选中了一个选项,取消了一个选项,这种怎么判断?

热点排行