Javascript validation error in asp.net
Hey all, I guess close to make this work. when I click btn without entering any thing in all three boxes
it gives validation. When I enter in all three boxes, it goes to the server side but gives an
Object does not support this property or method. The button is in FromView
<script language="javascript" type="text/javascript">
function
Confirm()
{
if ((document.getElementById('ctl00$pageDetailPanel$F V_UpdateUser$txtCpwd').value == "") ||(document.getElementById('ctl00$pageDetailPanel$ FV_UpdateUser$txtNpwd').value == "") || (document.getElementById('ctl00$pageDetailPanel$FV _UpdateUser$txtConpwd').value == "")) {
var lvConfirm=alert("You cannot leave the boxes blank");
return false;
}
<asp:Button ID="Button1" runat="server" Text="Update Password" CausesValidation=true OnClientClick="return Confirm();" CommandName="select" OnClick="btnPasswordUpdate_Click" /></ td>
return true;
}
</
script>
|