I am retrieving data from database and each dynamic row has one checkbox. and at the top of the table there is one submit button to send email to selected ids.
My ques is that i am unable to pass the values of all these checkboxes to that submit button which is in another form.
Please Help Me.. Its Lil Bit Urgent. Have to Complete in 3 days, and Only this thing is making trouble.
My code looks like..
Expand|Select|Wrap|Line Numbers
- try
- {
- Statement st1 = con.createStatement();
- Statement st2 = con.createStatement();
- Statement st3 = con.createStatement();
- ResultSet rs1 = st1.executeQuery("select * from consultant where (CLocation='"+Loc+"' or PLocation='"+Loc+"') or (TotalExp='"+Exp+"' or USExp='"+Exp+"') or (VisaType='"+visa+"')");
- if(rs1.next())
- {
- %>
- <form action="MultipleMail.jsp" style="position:absolute; top:60%; left:4%;">
- <input type="hidden" name="mailId" value="<%=smail%>" />
- <input type="submit" value="Send Mail To Selected Vendors" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:250px; cursor:pointer;" />
- </form>
- <table border="1" width="1250" id="ConsSearchDetails2" align="center">
- <tr style="color:#FFF; font-size:14px; font-family:Arial; background-color:#000;" height="50">
- <td></td>
- <td>Consultant Id</td>
- <td>Name</td>
- <td>Visa Type</td>
- <td>Current Location</td>
- <td>Preferred Location</td>
- <td>Relocation</td>
- <td>Availibility</td>
- <td>Total Experience</td>
- <td>US Experience</td>
- <td>Currently On Project</td>
- <td>Main Skill</td>
- <td>Sub Skills</td>
- </tr>
- <%
- ResultSet rs2 = st2.executeQuery("select * from consultant where (CLocation='"+Loc+"' or PLocation='"+Loc+"') or (TotalExp='"+Exp+"' or USExp='"+Exp+"') or (VisaType='"+visa+"')");
- while(rs2.next())
- {
- Cid = rs2.getString("ConsId");
- Fname = rs2.getString("FirstName");
- Lname = rs2.getString("LastName");
- VType = rs2.getString("VisaType");
- Clocation = rs2.getString("CLocation");
- Plocation = rs2.getString("PLocation");
- Relocation = rs2.getString("Relocation");
- Avail = rs2.getString("Availibility");
- Texp = rs2.getString("TotalExp");
- USexp = rs2.getString("USExp");
- Pro = rs2.getString("CurrentlyOnProject");
- Uid = rs2.getString("UserId");
- %>
- <tr height="55" style="background-color:#f7cf95;">
- <td>
- <form action="AdSearching.jsp" name="">
- <input type="checkbox" name="sendmail" value="<%=Uid%>" onchange="this.submit();" />
- </form>
- </td>
- <td><%=Cid%></td>
- <td><%=Fname+" "+Lname%></td>
- <td><%=VType%></td>
- <td><%=Clocation%></td>
- <td><%=Plocation%></td>
- <td><%=Relocation%></td>
- <td><%=Avail%></td>
- <td><%=Texp%></td>
- <td><%=USexp%></td>
- <td><%=Pro%></td>
- <%
- ResultSet rs3 = st3.executeQuery("select * from ConsSkills where ConsId = '"+Cid+"'");
- while(rs3.next())
- {
- Mskill = rs3.getString("MainSkill");
- Sskill = rs3.getString("SubSkill");
- %>
- <td><%=Mskill%></td>
- <td><%=Sskill%></td>
- <%
- }
- %>
- </tr>
- <tr style="background-color:#f2e3ce;">
- <td colspan="13" align="right" >
- <form action="SendMailToOne.jsp">
- <input type="hidden" name="id" value="<%=Uid%>" />
- <input type="submit" value="Send Mail" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:100px; cursor:pointer;" />
- </form>
- </td>
- </tr>
- <%
- }
- Statement st4 = con.createStatement();
- Statement st5 = con.createStatement();
- Statement st6 = con.createStatement();
- ResultSet rs4 = st4.executeQuery("select * from ConsSkills where MainSkill='"+Title+"' or SubSkill='"+sub+"'");
- if(rs4.next())
- {
- ResultSet rs5 = st5.executeQuery("select * from ConsSkills where MainSkill='"+Title+"' or SubSkill='"+sub+"'");
- while(rs5.next())
- {
- Cid2 = rs5.getString("ConsId");
- Mskill2 = rs5.getString("MainSkill");
- Sskill2 = rs5.getString("SubSkill");
- Uid2 = rs5.getString("UserId");
- ResultSet rs6 = st6.executeQuery("select * from Consultant where ConsId = '"+Cid2+"'");
- while(rs6.next())
- {
- Fname2 = rs6.getString("FirstName");
- Lname2 = rs6.getString("LastName");
- VType2 = rs6.getString("VisaType");
- Clocation2 = rs6.getString("CLocation");
- Plocation2 = rs6.getString("PLocation");
- Relocation2 = rs6.getString("Relocation");
- Avail2 = rs6.getString("Availibility");
- Texp2 = rs6.getString("TotalExp");
- USexp2 = rs6.getString("USExp");
- Pro2 = rs6.getString("CurrentlyOnProject");
- %>
- <tr height="55" style="background-color:#f7cf95;">
- <td><input type="checkbox" name="sendmail" value="<%=Uid%>" /></td>
- <td><%=Cid2%></td>
- <td><%=Fname2+" "+Lname2%></td>
- <td><%=VType2%></td>
- <td><%=Clocation2%></td>
- <td><%=Plocation2%></td>
- <td><%=Relocation2%></td>
- <td><%=Avail2%></td>
- <td><%=Texp2%></td>
- <td><%=USexp2%></td>
- <td><%=Pro2%></td>
- <td><%=Mskill2%></td>
- <td><%=Sskill2%></td>
- </tr>
- <tr style="background-color:#f2e3ce;">
- <td colspan="13" align="right" >
- <form action="SendMailToOne.jsp">
- <input type="hidden" name="id" value="<%=Uid2%>" />
- <input type="submit" value="Send Mail" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:100px; cursor:pointer;" />
- </form>
- </td>
- </tr>
- <%
- }
- }
- }
- else
- {
- }
- %>
- </table><br /><br />
- <%
- }
- else
- {
- Statement st7 = con.createStatement();
- ResultSet rs7 = st7.executeQuery("select * from ConsSkills where MainSkill = '"+Title+"'");
- if(rs7.next())
- {
- %>
- <form action="" style="position:absolute; top:60%; left:4%;">
- <input type="hidden" name="mailId" value="" />
- <input type="submit" value="Send Mail To Selected Vendors" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:250px; cursor:pointer;" />
- </form>
- <table border="1" width="1250" id="ConsSearchDetails2" align="center">
- <tr style="color:#FFF; font-size:14px; font-family:Arial; background-color:#000;" height="50">
- <td></td>
- <td>Consultant Id</td>
- <td>Name</td>
- <td>Visa Type</td>
- <td>Current Location</td>
- <td>Preferred Location</td>
- <td>Relocation</td>
- <td>Availibility</td>
- <td>Total Experience</td>
- <td>US Experience</td>
- <td>Currently On Project</td>
- <td>Main Skill</td>
- <td>Sub Skills</td>
- </tr>
- <%
- Statement st8 = con.createStatement();
- ResultSet rs8 = st8.executeQuery("select * from ConsSkills where MainSkill = '"+Title+"'");
- while(rs8.next())
- {
- Cid2 = rs8.getString("ConsId");
- Mskill2 = rs8.getString("MainSkill");
- Sskill2 = rs8.getString("SubSkill");
- Uid2 = rs8.getString("UserId");
- Statement st9 = con.createStatement();
- ResultSet rs9 = st9.executeQuery("select * from Consultant where ConsId = '"+Cid2+"'");
- while(rs9.next())
- {
- Fname2 = rs9.getString("FirstName");
- Lname2 = rs9.getString("LastName");
- VType2 = rs9.getString("VisaType");
- Clocation2 = rs9.getString("CLocation");
- Plocation2 = rs9.getString("PLocation");
- Relocation2 = rs9.getString("Relocation");
- Avail2 = rs9.getString("Availibility");
- Texp2 = rs9.getString("TotalExp");
- USexp2 = rs9.getString("USExp");
- Pro2 = rs9.getString("CurrentlyOnProject");
- %>
- <tr height="55" style="background-color:#f7cf95;">
- <td><input type="checkbox" name="sendmail" value="<%=Uid%>" /></td>
- <td><%=Cid2%></td>
- <td><%=Fname2+" "+Lname2%></td>
- <td><%=VType2%></td>
- <td><%=Clocation2%></td>
- <td><%=Plocation2%></td>
- <td><%=Relocation2%></td>
- <td><%=Avail2%></td>
- <td><%=Texp2%></td>
- <td><%=USexp2%></td>
- <td><%=Pro2%></td>
- <td><%=Mskill2%></td>
- <td><%=Sskill2%></td>
- </tr>
- <tr style="background-color:#f2e3ce;">
- <td colspan="13" align="right" >
- <form action="SendMailToOne.jsp">
- <input type="hidden" name="id" value="<%=Uid2%>" />
- <input type="submit" value="Send Mail" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:100px; cursor:pointer;" />
- </form>
- </td>
- </tr>
- <%
- }
- }
- %>
- </table><br /><br />
- <%
- }
- else
- {
- %>
- <div style="position:absolute; top:47%; left:38%; color:#F00; font-family:Arial; font-size:16px;">
- No Consultant Available. Please Try Again.
- </div>
- <%
- }
- }
- }
- catch(Exception e)
- {
- e.printStackTrace();
- %>
- <div style="position:absolute; top:50%; left:38%; color:#F00; font-family:Arial; font-size:16px;">
- May Be There Is Some Problem. Please <a href="ClientHome.jsp" style="text-decoration:none; color:inherit">Try Again.</a>
- </div>
- <%
- }