日期:2014-05-19  浏览次数:20469 次

|M| 想更改RegularExpressionValidator控件添加一个判断是否不为空的功能,大家帮看看
下面是生成的HTML在哪里加一段js可以让当T1为空时返回false  
谢谢
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<html   xmlns= "http://www.w3.org/1999/xhtml "   >
<head> <title>
无标题页
</title> </head>
<body>
        <form   name= "form1 "   method= "post "   action= "Default.aspx "   onsubmit= "javascript:return   WebForm_OnSubmit(); "   id= "form1 ">
<div>
<input   type= "hidden "   name= "__EVENTTARGET "   id= "__EVENTTARGET "   value= " "   />
<input   type= "hidden "   name= "__EVENTARGUMENT "   id= "__EVENTARGUMENT "   value= " "   />
<input   type= "hidden "   name= "__VIEWSTATE "   id= "__VIEWSTATE "   value= "/wEPDwUJMTA3MzgzNDYzZGR7cA39GfTp6FeOknPakCxFaPbt4w== "   />
</div>

<script   type= "text/javascript ">
<!--
var   theForm   =   document.forms[ 'form1 '];
if   (!theForm)   {
        theForm   =   document.form1;
}
function   __doPostBack(eventTarget,   eventArgument)   {
        if   (!theForm.onsubmit   ||   (theForm.onsubmit()   !=   false))   {
                theForm.__EVENTTARGET.value   =   eventTarget;
                theForm.__EVENTARGUMENT.value   =   eventArgument;
                theForm.submit();
        }
}
//   -->
</script>


<script   src= "/Web/WebResource.axd?d=nP-B40yeBbsJrm4QuiEHMg2&amp;t=633042217540000000 "   type= "text/javascript "> </script>


<script   src= "/Web/WebResource.axd?d=lSva9Ufyi4BtNn1ru4fVrbhqXLr_4gibY_Z6iF3ERy81&amp;t=633042217540000000 "   type= "text/javascript "> </script>
<script   type= "text/javascript ">
<!--
function   WebForm_OnSubmit()   {
if   (typeof(ValidatorOnSubmit)   ==   "function "   &&   ValidatorOnSubmit()   ==   false)   return   false;
return   true;
}
//   -->
</script>

        <input   name= "T1 "   type= "text "   value= "2 "   id= "T1 "   />
                <input   type= "submit "   name= "Button1 "   value= "Button "   onclick= "javascript:WebForm_DoPostBackWithOptions(new   WebForm_PostBackOptions(&quot;Button1&quot;,   &quot;&quot;,   true,   &quot;&quot;,   &quot;&quot;,   false,   false)) "   id= "Button1 "   />
               
              &n