aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes How to display the popup on the button click using Jquery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to display the popup on the button click using Jquery" Watch "How to display the popup on the button click using Jquery" New topic
Author

How to display the popup on the button click using Jquery

umesh annegirikar
Greenhorn

Joined: May 09, 2011
Posts: 29
hello friends
I am working on JSP currently i am facing the following problem
In my page there is button Add on that button i want to open JQuery popup but doing all that efforts i am not able to display the popup.
Following is my code.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.ArrayList"%>
<%@page import="com.udhc.model.City"%>
<%@page import="com.udhc.model.Country"%>
<%@page import="com.udhc.model.State"%>

<%@page import="com.udhc.config.ApplicationConstant"%>
<%@page import="com.udhc.model.User"%>
<%@page import="com.udhc.model.Professional"%>
<%@page import="org.apache.struts.Globals"%>


<jsp:include page="Header.jsp"></jsp:include>

<script type="text/javascript" language="javascript" src="js/jquery-1.4.3.min.js"></script>
<link type="text/css" href="css/stylesheet.css" rel="stylesheet"></link>
<script type="text/javascript">
$(document).ready(function ()
{
$("#btnShowSimple").click(function (e)
{
ShowDialog(false);
e.preventDefault();
});

$("#btnShowModal").click(function (e)
{
ShowDialog(true);
e.preventDefault();
});

$("#btnClose").click(function (e)
{
HideDialog();
e.preventDefault();
});

$("#btnSubmit").click(function (e)
{
var brand = $("#brands input:radio:checked").val();
$("#output").html("<b>Your favorite mobile brand: </b>" + brand);
HideDialog();
e.preventDefault();
});

});

function ShowDialog(modal)
{
$("#overlay").show();
$("#dialog").fadeIn(300);

if (modal)
{
$("#overlay").unbind("click");
}
else
{
$("#overlay").click(function (e)
{
HideDialog();
});
}
}

function HideDialog()
{
$("#overlay").hide();
$("#dialog").fadeOut(300);
}
</script>

<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


Also please guide me about how to use the jquery in jsp application.Some speciman code samples are appreciable
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to display the popup on the button click using Jquery
 
It's not a secret anymore!