Click here to Skip to main content
15,917,862 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have a Button inside Fancybox but it is not trigerring.
i'm using Fancybox 2.0.6 version.

although we need to change tag body to form to get button click worked which i already done in fancybox 1.3.4 but confuse how to do it in 2.0.6 version .

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    
    
    <link rel="stylesheet" type="text/css" media="all" href="style.css">
  <link rel="stylesheet" type="text/css" media="all" href="fancybox/jquery.fancybox.css">
  <script type="text/javascript" src="fancybox/jquery.min.js"></script>
  <script type="text/javascript" src="fancybox/jquery.fancybox.js?v=2.0.6"></script>
  
</head>
<body>
    <form id="form1" runat="server">
    
    
    <%--<div id="wrapper">
	<p>Send us feedback from the modal window.</p>--%>

	<p><a class="modalbox" href="#inline">click to open</a></p>
<%--</div>--%>

<!-- hidden inline form -->
<div id="inline">
	<h2>Send us a Message</h2>

	
		<table >
            <tr>
                <td >
                    <asp:Label ID="Label1" runat="server" Text="Name" CssClass="label"></asp:Label></td>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server" CssClass="txt"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td >
                    <asp:Label ID="Label2" runat="server" Text="Gender" CssClass="label"></asp:Label></td>
                <td>
                    <asp:TextBox ID="TextBox2" runat="server"  CssClass="txt"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td >
                   <asp:Label ID="Label3" runat="server" Text="Email" CssClass="label"></asp:Label></td>
                <td>
                    <asp:TextBox ID="TextBox3" runat="server"  CssClass="txt"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td >
                    <asp:Label ID="Label4" runat="server" Text="Address" CssClass="label"></asp:Label></td>
                <td>
                    <asp:TextBox ID="TextBox4" runat="server"  CssClass="txtarea"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td >
                    <asp:Label ID="Label5" runat="server" Text="Mobile" CssClass="label"></asp:Label></td>
                <td>
                    <asp:TextBox ID="TextBox5" runat="server"  CssClass="txt"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td >
                     </td>
                <td>
                    <asp:Button ID="send" runat="server" Text="Submit" onclick="send_Click" />
                </td>
            </tr>
            <tr>
                <td >
                     </td>
                <td>
                     </td>
            </tr>
            <tr>
                <td >
                     </td>
                <td>
                    <asp:Label ID="Label6" runat="server" CssClass="label"></asp:Label>
                </td>
            </tr>
        </table>
	
</div>
    
    
    
    
    </form>
    
    
    <!-- basic fancybox setup -->
<script type="text/javascript">

	$(document).ready(function() {
		$(".modalbox").fancybox();
		$("#form1").submit(function() { return false; });

		
		
	});
</script>

</body>
</html>
Posted

1 solution

You used JQuery code but didnot linked any JQuery file.
May be the problem occur for that.

you can try to add a JQuery file:
<script src="jquery-1.4.3.min.js" type="text/javascript"></script>
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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