仅当填写相同表单的所有必填字段(TextBox,DropDownList)时,如何才能启用Web表单中的提交按钮? [英] how can we enable submit button in web form only when all required fields(TextBox,DropDownList) of same form are filled?

查看:91
本文介绍了仅当填写相同表单的所有必填字段(TextBox,DropDownList)时,如何才能启用Web表单中的提交按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该怎么办,我的困惑是在检查哪个控件的事件时,我可以检查是否必须填写所有必填字段????
在这里,我们不会在提交按钮之前由用户填充哪个控件.

请给我建议

how can i do,my confusion is at which control''s event i can check condition that all required fields are filled or not???
here we don''t which control will be filled by user just before submit button.

please give me suggestion

推荐答案

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Disable Button</title>
    <script src="http://code.jquery.com/jquery-1.11.0.min.js" ></script>
    <script type="text/javascript">


(document).ready(function(){ validate();
(document).ready(function (){ validate();


('#txtName,#txtAddress,#txtPhone').change(validate); }); 函数validate(){ 如果(
('#txtName, #txtAddress, #txtPhone').change(validate); }); function validate(){ if (


这篇关于仅当填写相同表单的所有必填字段(TextBox,DropDownList)时,如何才能启用Web表单中的提交按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆