return false; is NOT working
Its a common error while handling logic operation in JavaScript.
Here i'm listing a few reason
Here chkduplicate() is my function
1.IF you are calling a function on OnClientClick event try to use return
before the function
<asp:Button ID="btnSaveFileFormat" runat="server" Text="Save File Type" class="btn_cl" OnClientClick='return chkduplicate();'Style="width: 195px; float: right" ValidationGroup="saveColumnDetails" OnClick="btnSaveFileFormat_Click" />
2. $(document).ready(function()
{
$('#<%=
btnSaveFileFormat.ClientID%>').click(function(e)
if
(chkduplicate() == false)
Its better that first methode.preventDefault();});});
3.
4.if you are using nested function don't give return false at child function instead of that give that at parent function<form onsubmit="return chkduplicate();">OR<form action="JAVASCRIPT:chkduplicate();"
If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)
No comments:
Post a Comment