Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display the popup on the button click using Jquery

 
umesh annegirikar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic