Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-06-2012, 12:44 PM   PM User | #1
jugal_thakkar
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
jugal_thakkar is an unknown quantity at this point
Post Selection of JSP Page based on Selected Radio Button and Submit Button

I want to Select a JSP Page from total 9 JSP page by Selecting that option using Radio Button & Redirect Selected button after Pressing Submit Button.........


Help Me Out...
I am sending my code with this post...which is as Follows...

Thanks
Jugal




<%@ 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">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
</head>
<body>


<hr />
<br />
<strong>Select Option From Follownig to Procced</strong>
<br />
<br />
<strong>Student</strong>
<br />
<br />
<form id="selectform" name="selectform" method="post" >
&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="addnewstu" id="addnewstu" />
Add a New Student</label>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="selseastu" id="selseastu" />
Search Studnet</label>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="genstudent" id="genstudent" />
Generate Student Report</label>
<br />


<br />
<strong>Faculty</strong>
<br />
<br />

&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="addnewfac" id="addnewfac" />
Add a New Faculty</label>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="selseafac" id="selseafac" />
Search Faculty Profile</label>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="genfaculty" id="genfaculty" />
Generate Faculty Report</label>
<br />


<br />
<strong>Support Staff</strong>
<br />
<br />

&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="addnewsupport" id="addnewsupport" />
Add a New Support Staff</label>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="selseasupport" id="selseasupport" />
Search Support Staff Profile</label>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="radio" name="select" value="gensupport" id="gensupport" />
Generate Support Staff Report</label>
<br />

<br />

<input name="Sumbit" type="submit" value="Submit" onclick="redirect" />
</form>
<br />
<br />

<hr />

</body>
<script type="text/javascript">
function redirect()
{
var selection = document.selectform.select;

for (i=0; i<selection.length; i++)

if (selection[i].checked == true)
if(selection[i].value=="addnewstu")
{
window.location.replace("addstudent.jsp");
}
else if(selection[i].value=="selseastu")
{
window.location.replace("");
}
else if(selection[i].value=="genstudent")
{
window.location.replace("");
}
else if(selection[i].value=="addnewfac")
{
window.location.replace("addfaculty.jsp");
}
else if(selection[i].value=="selseafac")
{
window.location.replace("");
}
else if(selection[i].value=="genfaculty")
{
window.location.replace("");
}
else if(selection[i].value=="addnewsupport")
{
window.location.replace("addsupport.jsp");
}
else if(selection[i].value=="selseasupport")
{
window.location.replace("");
}
else if(selection[i].value=="gensupport")
{
window.location.replace("");
}


}
</script>
</html>
jugal_thakkar is offline   Reply With Quote
Reply

Bookmarks

Tags
jsp, multiple, radio, redirect, submit

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:17 AM.


Advertisement
Log in to turn off these ads.