javascript函数 [英] javascript function
本文介绍了javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不能在asp.net中使用freetextbox调用我的javasript。
I can't call my javasript using a freetextbox in asp.net.
这里的代码我的javascript:
here's code my in javascript:
function validateFreetextbox()
{
if(document.FTB_API["txt_Decs"].GetHtml == '' )
{
alert("Please Fill up desciption.");
return false;
}
else
{
return true;
}
}
我的代码在asp.net中为按钮:
my code's in asp.net for button:
<asp:Button ID="btn_Add" runat="server" OnClick="btn_Add_Click" Text="Add"
Width="231px" Font-Size="11px" Font-Bold="false" ForeColor="#333333"
onclientclick=" validateFreetextbox()" />
推荐答案
应为 onclientclick = validateFreetextbox();
编辑:为了您的帮助,我刚刚在最后创建了一个页面试试它的工作...你可以制作新的页面,并在你的最后检查...
for your help, I have just created page at my end try and its working... can you make new page and check this at your end...
<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript" type="text/javascript">
function validateFreetextbox()
{
alert('Called');
// if(document.FTB_API["txt_Decs"].GetHtml == '' )
// {
// alert("Please Fill up desciption.");
// return false;
// }
// else
// {
// return true;
// }
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btn_Add" runat="server" Text="Add" Width="231px"
Font-Size="11px" Font-Bold="false" ForeColor="#333333" OnClientClick="validateFreetextbox()" OnClick="btn_Add_Click" />
</div>
</form>
</body>
</html>
这篇关于javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文