473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Selecting All Checkbox And Sending Mail

Hi,

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
  1. try
  2.     {
  3.         Statement st1 = con.createStatement();
  4.         Statement st2 = con.createStatement();
  5.         Statement st3 = con.createStatement();
  6.         ResultSet rs1 = st1.executeQuery("select * from consultant where (CLocation='"+Loc+"' or PLocation='"+Loc+"') or (TotalExp='"+Exp+"' or USExp='"+Exp+"') or (VisaType='"+visa+"')");
  7.         if(rs1.next())
  8.         {
  9.             %>            
  10.             <form action="MultipleMail.jsp" style="position:absolute; top:60%; left:4%;">
  11.                 <input type="hidden" name="mailId" value="<%=smail%>" />
  12.                 <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;" />
  13.             </form>
  14.             <table border="1" width="1250" id="ConsSearchDetails2" align="center">
  15.                 <tr style="color:#FFF; font-size:14px; font-family:Arial; background-color:#000;" height="50">
  16.                     <td></td>
  17.                     <td>Consultant Id</td>
  18.                     <td>Name</td>
  19.                     <td>Visa Type</td>
  20.                     <td>Current Location</td>
  21.                     <td>Preferred Location</td>
  22.                     <td>Relocation</td>
  23.                     <td>Availibility</td>
  24.                     <td>Total Experience</td>
  25.                     <td>US Experience</td>
  26.                     <td>Currently On Project</td>
  27.                     <td>Main Skill</td>
  28.                     <td>Sub Skills</td>
  29.                 </tr>
  30.             <%
  31.             ResultSet rs2 = st2.executeQuery("select * from consultant where (CLocation='"+Loc+"' or PLocation='"+Loc+"') or (TotalExp='"+Exp+"' or USExp='"+Exp+"') or (VisaType='"+visa+"')");
  32.             while(rs2.next())
  33.             {
  34.                 Cid = rs2.getString("ConsId");
  35.                 Fname = rs2.getString("FirstName");
  36.                 Lname = rs2.getString("LastName");
  37.                 VType = rs2.getString("VisaType");
  38.                 Clocation = rs2.getString("CLocation");
  39.                 Plocation = rs2.getString("PLocation");
  40.                 Relocation = rs2.getString("Relocation");
  41.                 Avail = rs2.getString("Availibility");                
  42.                 Texp = rs2.getString("TotalExp");
  43.                 USexp = rs2.getString("USExp");
  44.                 Pro = rs2.getString("CurrentlyOnProject");
  45.                 Uid = rs2.getString("UserId");
  46.                 %>
  47.                 <tr height="55" style="background-color:#f7cf95;">
  48.                     <td>
  49.                         <form action="AdSearching.jsp" name="">
  50.                         <input type="checkbox" name="sendmail" value="<%=Uid%>" onchange="this.submit();" />
  51.                         </form>
  52.                     </td>
  53.                     <td><%=Cid%></td>
  54.                     <td><%=Fname+" "+Lname%></td>
  55.                     <td><%=VType%></td>
  56.                     <td><%=Clocation%></td>
  57.                     <td><%=Plocation%></td>
  58.                     <td><%=Relocation%></td>
  59.                     <td><%=Avail%></td>                    
  60.                     <td><%=Texp%></td>
  61.                     <td><%=USexp%></td>
  62.                     <td><%=Pro%></td>
  63.  
  64.                 <%
  65.  
  66.                 ResultSet rs3 = st3.executeQuery("select * from ConsSkills where ConsId = '"+Cid+"'");
  67.                 while(rs3.next())
  68.                 {
  69.                     Mskill = rs3.getString("MainSkill");
  70.                     Sskill = rs3.getString("SubSkill");
  71.                     %>
  72.                     <td><%=Mskill%></td>
  73.                     <td><%=Sskill%></td>
  74.                     <%
  75.                 }
  76.                 %>
  77.                 </tr>
  78.                 <tr style="background-color:#f2e3ce;">                                    
  79.                     <td colspan="13" align="right" >
  80.                         <form action="SendMailToOne.jsp">
  81.                             <input type="hidden" name="id" value="<%=Uid%>" />
  82.                             <input type="submit" value="Send Mail" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:100px; cursor:pointer;" />    
  83.                         </form>                                    
  84.                     </td>
  85.                 </tr>
  86.                 <%
  87.             }
  88.  
  89.                 Statement st4 = con.createStatement();
  90.                 Statement st5 = con.createStatement();
  91.                 Statement st6 = con.createStatement();
  92.  
  93.                 ResultSet rs4 = st4.executeQuery("select * from ConsSkills where MainSkill='"+Title+"' or SubSkill='"+sub+"'");
  94.                 if(rs4.next())
  95.                 {
  96.                     ResultSet rs5 = st5.executeQuery("select * from ConsSkills where MainSkill='"+Title+"' or SubSkill='"+sub+"'");
  97.                     while(rs5.next())
  98.                     {
  99.                         Cid2 = rs5.getString("ConsId");
  100.                         Mskill2 = rs5.getString("MainSkill");
  101.                         Sskill2 = rs5.getString("SubSkill");    
  102.                         Uid2 = rs5.getString("UserId");
  103.  
  104.                         ResultSet rs6 = st6.executeQuery("select * from Consultant where ConsId = '"+Cid2+"'");
  105.                         while(rs6.next())
  106.                         {
  107.                             Fname2 = rs6.getString("FirstName");
  108.                             Lname2 = rs6.getString("LastName");
  109.                             VType2 = rs6.getString("VisaType");
  110.                             Clocation2 = rs6.getString("CLocation");
  111.                             Plocation2 = rs6.getString("PLocation");
  112.                             Relocation2 = rs6.getString("Relocation");
  113.                             Avail2 = rs6.getString("Availibility");                
  114.                             Texp2 = rs6.getString("TotalExp");
  115.                             USexp2 = rs6.getString("USExp");
  116.                             Pro2 = rs6.getString("CurrentlyOnProject");
  117.                             %>
  118.                             <tr height="55" style="background-color:#f7cf95;">
  119.                                 <td><input type="checkbox" name="sendmail" value="<%=Uid%>" /></td>
  120.                                 <td><%=Cid2%></td>
  121.                                 <td><%=Fname2+" "+Lname2%></td>
  122.                                 <td><%=VType2%></td>
  123.                                 <td><%=Clocation2%></td>
  124.                                 <td><%=Plocation2%></td>
  125.                                 <td><%=Relocation2%></td>
  126.                                 <td><%=Avail2%></td>                    
  127.                                 <td><%=Texp2%></td>
  128.                                 <td><%=USexp2%></td>
  129.                                 <td><%=Pro2%></td>
  130.                                 <td><%=Mskill2%></td>
  131.                                 <td><%=Sskill2%></td>
  132.                             </tr>
  133.                             <tr style="background-color:#f2e3ce;">                                    
  134.                                 <td colspan="13" align="right" >
  135.                                     <form action="SendMailToOne.jsp">
  136.                                         <input type="hidden" name="id" value="<%=Uid2%>" />
  137.                                         <input type="submit" value="Send Mail" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:100px; cursor:pointer;" />    
  138.                                     </form>                                    
  139.                                 </td>
  140.                             </tr>  
  141.                             <%
  142.                         }
  143.                     }
  144.                 }
  145.                 else
  146.                 {
  147.                 }
  148.  
  149.             %>                
  150.             </table><br /><br />
  151.             <%
  152.         }
  153.         else
  154.         {
  155.                 Statement st7 = con.createStatement();
  156.  
  157.                 ResultSet rs7 = st7.executeQuery("select * from ConsSkills where MainSkill = '"+Title+"'");
  158.                 if(rs7.next())
  159.                 {
  160.                     %>
  161.                     <form action="" style="position:absolute; top:60%; left:4%;">
  162.                         <input type="hidden" name="mailId" value="" />
  163.                         <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;" />
  164.                     </form>
  165.                     <table border="1" width="1250" id="ConsSearchDetails2" align="center">
  166.                         <tr style="color:#FFF; font-size:14px; font-family:Arial; background-color:#000;" height="50">
  167.                             <td></td>
  168.                             <td>Consultant Id</td>
  169.                             <td>Name</td>
  170.                             <td>Visa Type</td>
  171.                             <td>Current Location</td>
  172.                             <td>Preferred Location</td>
  173.                             <td>Relocation</td>
  174.                             <td>Availibility</td>
  175.                             <td>Total Experience</td>
  176.                             <td>US Experience</td>
  177.                             <td>Currently On Project</td>
  178.                             <td>Main Skill</td>
  179.                             <td>Sub Skills</td>
  180.                         </tr>
  181.                     <%
  182.                     Statement st8 = con.createStatement();                
  183.                     ResultSet rs8 = st8.executeQuery("select * from ConsSkills where MainSkill = '"+Title+"'");
  184.                     while(rs8.next())
  185.                     {
  186.                         Cid2 = rs8.getString("ConsId");
  187.                         Mskill2 = rs8.getString("MainSkill");
  188.                         Sskill2 = rs8.getString("SubSkill");    
  189.                         Uid2 = rs8.getString("UserId");
  190.  
  191.                         Statement st9 = con.createStatement();
  192.                         ResultSet rs9 = st9.executeQuery("select * from Consultant where ConsId = '"+Cid2+"'");
  193.                         while(rs9.next())
  194.                         {
  195.                             Fname2 = rs9.getString("FirstName");
  196.                             Lname2 = rs9.getString("LastName");
  197.                             VType2 = rs9.getString("VisaType");
  198.                             Clocation2 = rs9.getString("CLocation");
  199.                             Plocation2 = rs9.getString("PLocation");
  200.                             Relocation2 = rs9.getString("Relocation");
  201.                             Avail2 = rs9.getString("Availibility");                
  202.                             Texp2 = rs9.getString("TotalExp");
  203.                             USexp2 = rs9.getString("USExp");
  204.                             Pro2 = rs9.getString("CurrentlyOnProject");
  205.                             %>
  206.                             <tr height="55" style="background-color:#f7cf95;">
  207.                                 <td><input type="checkbox" name="sendmail" value="<%=Uid%>" /></td>
  208.                                 <td><%=Cid2%></td>
  209.                                 <td><%=Fname2+" "+Lname2%></td>
  210.                                 <td><%=VType2%></td>
  211.                                 <td><%=Clocation2%></td>
  212.                                 <td><%=Plocation2%></td>
  213.                                 <td><%=Relocation2%></td>
  214.                                 <td><%=Avail2%></td>                    
  215.                                 <td><%=Texp2%></td>
  216.                                 <td><%=USexp2%></td>
  217.                                 <td><%=Pro2%></td>
  218.                                 <td><%=Mskill2%></td>
  219.                                 <td><%=Sskill2%></td>
  220.                             </tr>
  221.                             <tr style="background-color:#f2e3ce;">                                    
  222.                                 <td colspan="13" align="right" >
  223.                                     <form action="SendMailToOne.jsp">
  224.                                         <input type="hidden" name="id" value="<%=Uid2%>" />
  225.                                         <input type="submit" value="Send Mail" style="background-color:#f5a430; border:0; color:#FFF; font-weight:bold; height:30px; width:100px; cursor:pointer;" />    
  226.                                     </form>                                    
  227.                                 </td>
  228.                             </tr>  
  229.                             <%
  230.                         }                        
  231.                     }
  232.                     %>                    
  233.                     </table><br /><br />
  234.                     <%
  235.                 }
  236.                 else
  237.                 {
  238.                 %>
  239.                     <div style="position:absolute; top:47%; left:38%; color:#F00; font-family:Arial; font-size:16px;">
  240.                         No Consultant Available. Please Try Again.
  241.                        </div>
  242.                 <%
  243.  
  244.             }
  245.         }
  246.     }
  247.     catch(Exception e)
  248.     {
  249.         e.printStackTrace();
  250.         %>
  251.             <div style="position:absolute; top:50%; left:38%; color:#F00; font-family:Arial; font-size:16px;">
  252.                 May Be There Is Some Problem. Please <a href="ClientHome.jsp" style="text-decoration:none; color:inherit">Try Again.</a>
  253.                </div>
  254.         <%
  255.     }
Jul 24 '14 #1
0 1195

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: prasanna | last post by:
Hello I tried to send mail from PHP in html format. But an ! mark appears in mail body in Inbox. I tried to print body text on page before sending mail and it does not show ! mark. I replaced !...
9
by: Leo Breebaart | last post by:
I am writing a utility in Python and I'd like to add a command-line option "--mailto <address>" that will cause an e-mail summary to be sent to <address> when the utility finishes running. My...
3
by: HoustonComputerGuy | last post by:
I am working on getting my web applications moved to .Net 2.0 and am having some problems with System.Net.Mail. I get the following error when sending the mail: System.Net.Mail.SmtpException was...
2
by: HK | last post by:
In VB.NET, I'm getting the exception "failure sending mail". I'm running VS 2005 on XP Home. This is a new install on a new PC. I've never had email problems with VS 2003, and there I could...
5
by: Zile | last post by:
I am trying to send mail from web page in asp.net 2.0/VB 2005: Dim Poruka As New System.Web.Mail.MailMessage myMessage.From = "matematic@gmail.com" myMessage.To = "matematic@hotmail.com"...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
2
by: Danny | last post by:
Hi all, Trying to send mail with System.Net.SmtpClient, using very simple code just for testing: SmtpClient smtp = new SmtpClient("mail.server.com", 25); smtp.Credentials = new...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
1
by: jagdeep gupta | last post by:
10.2 How to send emails by using System.Net.Mail CODE-BEHIND: MailMessage message = new MailMessage(); message.From = new MailAddress("fromusername@DomainName"); message.To.Add(new...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.