I'm using javascript with regard to customValidator to verify textboxes within ASP.Internet. The actual code works completely when I 'm using a normal web page, but as soon as I put which in the MasterPage, the actual code fails.
Beneath is the code with regard to my aspx web page. Basically put this signal inside a MasterPage it doesn't function. Could you guys advise me steps to make this work in the MasterPage
The actual piece of software is:-
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<script type="text/javascript">
function validateOrFields(source, args)
var sUser = document.getElementById('TextBox1');
if (sUser.value == "")
args.IsValid = false;
else
args.IsValid = true;
return;
<div>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<asp:CustomValidator ID="FieldValidator"
runat="server"
Text="Enter either a user name"
ClientValidationFunction="validateOrFields" onservervalidate="FieldValidator_ServerValidate"/>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
</html>
|