Click here to Skip to main content
15,895,370 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
on button click i call one javascript function,but there is also validation...but its not working...wat to do now??

additional information copied from comment below
this is my code:

ASP.NET
<center><p style="font-size:15px"><asp:TextBox ID="txtpaymentdate" runat="server" style="text-align:center">
        <ajaxToolkit:CalendarExtender ID="calender"  runat="server" TargetControlID="txtpaymentdate">

<asp:Button ID="btnsubmit" runat="server" Text="Submit" Width="90px" 
                    ValidationGroup="valgrp" OnClientClick="return submitpanel(this);"   />

C#
function submitpanel(eval) {
        debugger;

       document.getElementById('<%= panelgrid.ClientID %>').style.display = 'none';
        document.getElementById('<%= pnl2.ClientID %>').style.display = 'block';
        return false;</center>
Posted
Updated 20-Dec-13 0:17am
v3
Comments
Vishal Pand3y 20-Dec-13 3:38am    
Your question is not clear at all i will suggest u to improve your question and provide more detail......
Ashish_Agrawal 20-Dec-13 6:48am    
"but its not working" means the function is not getting called?

Hi in code block you are returning false value in submitpanel function so please return true otherwise runtime event will not occur after calling javascript function.


so please change your code and write return true at the end of the submitpanel function.

Thanks,
Bhavesh
 
Share this answer
 
Please show your code here......
 
Share this answer
 
Comments
Member 10276220 20-Dec-13 3:40am    
this is my code:

<p style="font-size:15px"><asp:TextBox ID="txtpaymentdate" runat="server" style="text-align:center">
<ajaxToolkit:CalendarExtender ID="calender" runat="server" TargetControlID="txtpaymentdate">

<asp:Button ID="btnsubmit" runat="server" Text="Submit" Width="90px"
ValidationGroup="valgrp" OnClientClick="return submitpanel(this);" />

function submitpanel(eval) {
debugger;

document.getElementById('<%= panelgrid.ClientID %>').style.display = 'none';
document.getElementById('<%= pnl2.ClientID %>').style.display = 'block';
return false;
Karthik_Mahalingam 20-Dec-13 3:41am    
HI Jain, Please use Have a Question or Comment? button to ask queries, suggestions etc...
Dont use solution, unless it is a solution..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900