问题描述
< asp:Button ID =btnGetReportrunat =ServerText =Get ReportOnClick =btnGetReport_ClickOnClientClick =return IsValidDate(''aspnetForm'',''ctl00_ContentPlaceHolderBody_txtDateFrom'',''开始date'');返回IsValidDate(''aspnetForm'',''ctl00_ContentPlaceHolderBody_txtDateTo'',''结束日期'');/>
在上面代码我两次调用相同的函数来验证两个控件..
这里只有第四个函数被执行而不是第二个返回语句...
这里如何检查我的IsValidDate()函数返回的内容..
以及如何在IsValidDate的基础上为txtDateTo文本框调用IsValidDate()函数( )txtDateFrom的功能。
请帮助..
<asp:Button ID="btnGetReport" runat="Server" Text="Get Report" OnClick="btnGetReport_Click" OnClientClick = "return IsValidDate(''aspnetForm'',''ctl00_ContentPlaceHolderBody_txtDateFrom'', ''Start date'');return IsValidDate(''aspnetForm'',''ctl00_ContentPlaceHolderBody_txtDateTo'', ''End date'');"/>
In above code i am calling same function two times to validate two control..
Here only fist function gets executed not second cozz of return statement..
Here how to check that what my IsValidDate() function returns..
and how to call IsValidDate() function for txtDateTo text box on the basis of IsValidDate() function of txtDateFrom.
please help..
推荐答案
OnClientClick = "return IsValidDate('aspnetForm','ctl00_ContentPlaceHolderBody_txtDateFrom', 'Start date') && IsValidDate('aspnetForm','ctl00_ContentPlaceHolderBody_txtDateTo', 'End date');"
这篇关于javascript问题请帮忙...... !!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!