<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page language="java"%> <%@page import="java.sql.*"%> <html> <head> <title>Post Available Bench</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="css/masterStyle.css" /> <script type="text/javascript"> function getOptions1(Countrytype) { var list; var list1; var listValue; var listValue1; if (Countrytype == "India") { list = new Array("Andrapradesh","Bihar","Gujarat","Karnataka","Kerala","Madhya Pradesh","Maharastra","Orissa","Tamilnadu"); listValue = new Array("Andrapradesh","Bihar","Gujarat","Karnataka","Kerala","Madhya Pradesh","Maharastra","Orissa","Tamilnadu"); list1 = new Array("Hyderabad","Patna","Ahmedabad","Benguluru","Kochi","Bhopal","Mumbai","Cuttack","Chennai"); listValue1=new Array("Hyderabad","Patna","Ahmedabad","Benguluru","Kochi","Bhopal","Mumbai","Cuttack","Chennai"); } for (var i = 0; i < document.benchForm.country.length; i++) { //Clear the 2nd menu document.benchForm.state.options[i] = null; document.benchForm.city.options[i] = null; } for (var i = 0; i < list.length; i++) { //Repopulate 2nd menu document.benchForm.state.options[i] = new Option(list[i],listValue[i],0,0); document.benchForm.city.options[i] = new Option(list1[i],listValue1[i],0,0); } } function addRow(){ var tbody = document.getElementById("tbodyId"); var current_row=document.createElement("TR"); var current_cell1=document.createElement("TD"); var input=document.createElement("INPUT"); input.type="checkbox"; input.id="active"; input.name="active"; current_cell1.appendChild(input); current_row.appendChild(current_cell1); var current_cell2=document.createElement("TD"); var input=document.createElement("INPUT"); input.type="text"; input.id="resourceName"; input.name="resourceName"; current_cell2.appendChild(input); current_row.appendChild(current_cell2); var current_cell3=document.createElement("TD"); var input=document.createElement("INPUT"); input.type="text"; input.id="expYears"; input.name="expYears"; current_cell3.appendChild(input); current_row.appendChild(current_cell3); var current_cell4=document.createElement("TD"); var input=document.createElement("INPUT"); input.type="text"; input.id="primaryskill"; input.name="primaryskill"; current_cell4.appendChild(input); current_row.appendChild(current_cell4); var current_cell5=document.createElement("TD"); var input=document.createElement("INPUT"); input.type="text"; input.id="available"; input.name="available"; current_cell5.appendChild(input); current_row.appendChild(current_cell5); var current_cell6=document.createElement("TD"); var input=document.createElement("INPUT"); input.type="text"; input.id="expires"; input.name="expires"; current_cell6.appendChild(input); current_row.appendChild(current_cell6); var current_cell7=document.createElement("TD"); var input=document.createElement("INPUT"); input.type="hidden"; input.id="companyName"; input.name="companyName"; input.value="<%= session.getAttribute( "theName" ) %>"; current_cell7.appendChild(input); current_row.appendChild(current_cell7); tbody.appendChild(current_row); } function generatenew() { var d=document.getElementById("div"); d.innerHTML+="<p><input type='text' name='otherprimaryskill'>"; } function generatenew1() { var d=document.getElementById("div1"); d.innerHTML+="<p><input type='text' name='othersecondaryskill'>"; } function getOptions(skilltype) { var list; var listValue; if (skilltype == "Java") { list = new Array("CoreJava","J2EE","J2SE","Struts","Hibernet","Springs","JSP","Servlet","JavaScript"); listValue = new Array("CoreJava","J2EE","J2SE","Struts","Hibernet","Springs","JSP","Servlet","JavaScript"); } if (skilltype == ".NET") { list = new Array("ASP.NET","C#","VB.NET"); listValue = new Array("ASP.NET","C#","VB.NET"); } if (skilltype == "Database") { list = new Array("MySql","SQL","oracle"); listValue = new Array("MySql","SQL","oracle"); } for (var i = 0; i < document.benchForm.primaryskill.length; i++) { //Clear the 2nd menu document.benchForm.Skills.options[i] = null; } for (var i = 0; i < list.length; i++) { //Repopulate 2nd menu document.benchForm.Skills.options[i] = new Option(list[i],listValue[i],0,0); } } function f2Submit() { document.benchForm1.action="PostController" document.benchForm1.submit(); alert('Form Submitted'); } function f1Submit() { document.benchForm.action="PostavailableController" document.benchForm.submit(); } function submitAll() { f2Submit(); f1Submit(); } </script> </head> <% String message = (String) request.getAttribute("message"); String error = (String) request.getAttribute("error"); String theName = (String) session.getAttribute("theName"); %> <% if (theName== null || theName.equals("")) { request.setAttribute("error", "User Session Expired"); %> <jsp:forward page="Register.jsp"/> <% } %> <body> <div id="headerWrapper"> <div id="header"> <p><center><font size="5"/> Post Available Bench</center></p> </div> </div> <form name="benchForm" id="benchForm" action="PostavailableController" method="POST" > <table width="100%" align="center"> <tr> <td align="right"></td> <td align="left"> <input type="hidden" name="companyName" value="<%= session.getAttribute( "theName" ) %>" size="20" value=""></td> </tr> <tr> <td align="right">Country </td> <td align="left">: <select name="country" onchange="getOptions1(this.value)"> <option value="">Select Country</option> <option value="India">India</option> <option value="USA">USA</option> <option value="UK">UK</option> <option value="Singapore">Singapore</option> <option value="Australia">Australia</option> </select> </td> </tr> <tr> <td align="right">State</td> <td align="left">:<select name="state" > <option value="">Select State</option> </select> </tr> <tr> <td align="right">City</td> <td align="left">:<select name="city" > <option value="">Select City</option> </select> </tr> <tr> <td align="right">Industry</td> <td align="left">: <select name="industry"> <option value="IT Services">IT Services</option> <option value="IT Product">IT Product</option> <option value="ITES">ITES</option> <option value="Other">Other</option> </select> </td> </tr> <tr> <td align="right">Primary Skill:</td> <td align="left"> <select name="primaryskill" onchange="getOptions(this.value)"> <option value="">Select Skills</option> <option value="Java">Java</option> <option value=".NET">.NET</option> <option value="Database">Database</option> </select> </td> <tr> <td> <div id="div" align="right" > <input type="button" value="Other Skills" onclick="generatenew()" class="BtnStyle"></div> </td> </tr> <tr> <td align="right"> Secondary Skill:</td> <td align="left"><select name="Skills" > <option value="">Select Skills</option> </select> </td> </tr> </center> <tr> <td> <div id="div1" align="right" > <input type="button" value="Other Skills" onclick="generatenew1()" class="BtnStyle"></div> </td> </tr> <tr> <td align="right">Name</td> <td align="left">: <input type="text" name="name" size="20" value=""></td> </tr> <tr> <td align="right">Title</td> <td align="left">: <select name="title"> <option value="Mr.">Mr.</option> <option value="Mrs.">Mrs.</option> <option value="Ms.">Ms.</option> </select> </td> </tr> <tr> <td align="right">Role</td> <td align="left">: <select name="role"> <option value="Head of the Company">Head of the Company</option> <option value="india">Head of the Company</option> <option value="Head of HR">Head of HR</option> <option value="Head of Talent Acquisition">Head of Talent Acquisition</option> <option value="Head of Delivery">Head of Delivery</option> <option value="Head of Technology Practice">Head of Technology Practice</option> <option value="Head of Commercial">Head of Commercial</option> <option value="Head of Operations">Head of Operations</option> </select> </td> </tr> <tr> <td align="right">Email</td> <td align="left">: <input type="text" name="mail" size="20" value=""></td> </tr> <tr> <td align="right">Phone</td> <td align="left">: <input type="text" name="phone" size="20" value=""></td> </tr> <!-- <tr> <td align="right">Availability date</td> <td align="left">: <input type="text" id="demo1" name="availabilityDate" size="20"> <a href="javascript:NewCal('demo1','DDMMYYYY',false,24)"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> </td> </tr> <tr> <td align="right">Availability expires on</td> <td align="left">: <input type="text" id="demo2" name="availabilityExpires" size="20"> <a href="javascript:NewCal('demo2','DDMMYYYY',false,24)"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> </td> </tr>--> <tr> <td align="right">Experience Years :</td> <td align="left"> <select name="expYears"> <% for (int i = 0; i < 10; i++) { %> <option value="<%=i%>"><%=i%></option> <% } %> </select> </td> </tr> <tr> <td align="right">No of Resource Available :</td> <td align="left"> <select name="noOfResources"> <% for (int i = 0; i < 10; i++) { %> <option value="<%=i%>"><%=i%></option> <% } %> </select> </td> </tr> <tr> <td align="right">Comments :</td> <td align="left"> <textarea name="comments" rows="5" cols="20"></textarea></td> </tr> </table> <br/> </form> <form name="benchForm1" id="benchForm1" action="PostController" method="POST" > <body onload="addRow();"> <center> <table border="2" style="border-color: black;border-style: solid name=Resource" > <tr bgcolor="yellow"> <th>Active</th> <th>Resource Name</th> <th>Experience</th> <th>Skills</th> <th>Available On</th> <th>Expires On</th> </tr></center> <tbody id="tbodyId"></tbody> <tr > <center> <td > <input type="button" value="Add" onclick="addRow();" /> </td> </center> </tr> </table> </center> </form> <form name="frm" action="javascript:submitAll()" method="GET"> <center> <input type="submit" value="Submit" class="BtnStyle" > </center> </form> <center> <div id="footer"> <hr /> <div id="copyright"> <p>© 2011, ShareMyResources. All Rights Reserved</p> </div> <div id="footerNav"> <ul> <li><a href="#">About</a></li> <li><a href="#">Advertise</a></li> <li><a href="#">Sitemap</a></li> <li><a href="#">Terms</a></li> <li><a href="#">Career</a></li> <li><a href="#">Contact Us</a></li> </ul> </div> </div> </center> </body> </html>
Hi sir,
This my coding in this i have two forms and in second form i have to upload resume inside the grid view of the table and finally if i submit the page,two form with resume also want to submit i was struggling this issue for so many days so please send the solution for this problem as soon as possible...
Regards, R.Santhosh.
Ads