Question

send email out then submit is clicked and checkbox is checked?

Asked by: pigmentarts

My webpage sends email out then submit is clicked, I need it to only send out a email if one of the check boxes on the form has been checked when submited

How can I do this.  

my code is below

________________


<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Web.Mail" %>

<script language="VB" runat="server">
            
             Sub Submit_Click(Sender as Object, e as EventArgs)
             Dim cnn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("cl.mdb"))
        Dim cmd As New OleDb.OleDbCommand

          Page.Validate
If Page.IsValid Then
        cmd.CommandText = "INSERT INTO members (title, first_name, last_name, company_name, house_number_name, street, address1, address2, town, postcode, telephone, fax, email, pass, web_address, sector, no_employees, hear_about_us, callback, keep_todate) VALUES ('" & title.Value  & "', '" & first_name.Value  & "', '" & last_name.Value  & "', '" & company_name.Value  & "', '" & house_number_name.Value  & "', '" & street.Value  & "', '" & address1.Value  & "', '" & address2.Value  & "', '" & town.Value  & "', '" & postcode.Value  & "', '" & telephone.Value  & "', '" & fax.Value  & "', '" & email.Value  & "', '" & pass.Value  & "', '" & web_address.Value  & "', '" & sector.Value  & "', '" & no_employees.Value  & "', '" & hear_about_us.Value  & "', '" & callback.checked & "', '" & keep_todate.checked & "')"

        cmd.Connection = cnn

        cnn.Open()
        cmd.ExecuteNonQuery()
        cnn.Close()

        cmd.Dispose()
        cnn.Dispose()
            
            
    If request.form("email") <> ""
      
        Dim mail As New MailMessage
        mail.From = request.form ("email")
        mail.To = "glynj@pcdi.co.uk"
        mail.Subject = "Request for call back"
        mail.Body = "User submitted a request for call back using the online registration form." & "<br>" & "Client Name: " & request.Form("first_name") & " " & request.Form("last_name") & "<br>" & "Telephone number recorded: " & request.form ("telephone") & "<br> Email powered by webwordz"
        mail.BodyFormat = MailFormat.Html
               SmtpMail.SmtpServer = "10.0.0.2"
            SmtpMail.Send(mail)
            
            
            Dim mail2 As New MailMessage
        mail2.From = "somewhere"
        mail2.To = request.Form("email")
        mail2.Subject = "Thank you for registering"
        mail2.Body = "User submitted a request for call back using the online registration form."
        mail2.BodyFormat = MailFormat.Html
               SmtpMail.SmtpServer = "10.0.0.2"
            SmtpMail.Send(mail2)
             
    End If

          Response.Redirect("thankyou.html")
Else
'Do Whatever
End IF
     
     end sub


      
      </script>
      
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/mainTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="quotes.js"></SCRIPT>

<script>
function quotePrint()
{
var index = parseInt(Math.random()*Quotes.length)

return(Quotes[index])
}

</script>
      <!-- InstanceBeginEditable name="doctitle" -->
      <title>Register Page</title>
      <!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <!-- InstanceBeginEditable name="head" -->
      <style type="text/css">
<!--
.style6 {font-size: 9px}
-->
    </style>
      <!-- InstanceEndEditable -->
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
      font-size: 16px;
      font-weight: bold;
}
.style4 {font-size: 14px}
.style5 {font-size: 14px; font-weight: bold; }
-->
</style>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
      <tr>
            <td style="width: 5%; background: #EEE; border-right: 1px solid #AAA;">&nbsp;</td>
            <td>
            <div class="londonLandscape">
                  <a href="index.html" target="_self"><img src="images/logo.gif" alt="Connecting London Logo" border="0" align="left" style="margin-right: 10px; "></a>
                  <img src="images/londonpic.jpg" alt="Connecting London Logo" align="right">
              <div style="padding-top: 15px; "><br />
                  <span class="textSize style1"><span class="textSize style4">Information - Communications - Technology</span></span><span class="style5"></span><span class="style1"><br />
               </span>              <span class="blueText">We support you...</span></div>
              <span class="blueText">not just your systems!</span></div>
            </div>
            <div id="topmenu1">
                <div style="float:right; "><a href="aboutus.html" target="_self">about us</a> | <a href="contactus.html" target="_self">contact us</a> | <a href="legal.html"> legal</a> | <a href="careers.html" target="_self">careers</a> | <a href="sitemap.html" target="_self">sitemap</a></div>
                         <!-- InstanceBeginEditable name="stat" -->home&gt;register<!-- InstanceEndEditable -->
            </div>
            <div style="clear: both; margin-top: 20px;">
                  <div class="box3">
                  <div class="specialOfferBox">
                  <div class="smallTitle" style="color:#FF0000; font-size: 12px;">Special Offer This Month</div>
            </div>
            <div class="graybox">
                  <center><b>
                  <p>EMAIL PROTECTION AGENCY (EPA) SPAM PROTECTION FOR BUSINESS:</p>
                  <p class="FreeTrial"> FREE 15-DAY TRIAL</p>
                  <p>EPA Spam Potection is <br>
                    available to registered <br>
                    Connecting London <br>
                members FREE for 15 days.</p>
                  </b>
                    <p>members click here <a href="membercheck.aspx">click here</a>.
                  <p class="textSize">If you are not a Connecting London member, and would like to apply for membership please register <span class="redlink"><a href="register.aspx">click here
                  </a></span><br>
                  <br>There's no charge for joining, and you do not have to be an existing client.</p>
                  </center>
            </div>
            <div class="smallTitle">Our business partners</div>
                  <div class="graybox" align="center">
                    <img src="images/logos.jpg" alt="logos">
            </div>
      </div>
<div class="box1">
            <div id="nav" style="padding-bottom: 30px; ">
                  <ul class="level1">
                  <li><a href="index.html"><strong>Home</strong></a></li>
                  <li><a href="private_clients .html"><strong>Private Client Computing</strong></a></li>
                  <li class="submenu"><a href="corporate_client_computing.html"><strong>Corporate Client Computing </strong></a>
                   <ul class="level2">
                   <li><a href="corporate_client_consultancy.html">Consultancy</a></li>
                  <li><a href="/">Networks</a></li>
                  <li><a href="/">Computer Services</a></li>
                  <li><a href="communications_services.html">Communications Services </a></li>
                  <li><a href="internet_services.html">Internet Services</a></li>
                  <li><a href="training_and_familiarisation.html">Training</a></li>
                  <li><a href="service_and_maintenance.html">Service and Maintenance</a></li>
                  <li><a href="/">Financing</a></li>
             </ul>
            </li>
            <li><a href="computer_systems_maintenance_service_and_support.html"><strong>Service & Maintenance</strong></a></li>
            <li><a href="case_histories.html"><strong>Case Histories</strong></a></li>
              <li><a href="customer_charter.html"><strong>Customer Charter</strong></a></li>
        </ul>
</div>
<div class="smallTitle" align="right">Members Email Login</div>
      <div class="graybox"><form method="post" action="membercheck.aspx">
      <center>
      
      


      User Name
      <input name="username" type="text">
      Password
      <input name="password" type="password">
      <br>
      <div align="right">
      <input name="Login" type="submit" value="Login">
      
      </div>
      </center></form>
      If you are a registered member and want to access the members area please <a href="membercheck.aspx">click here</a>      </div>
      <div class="smallTitle" align="right">What our clients say about us</div>
      <div class="graybox">
            <script>document.write(quotePrint())</script>
      </div>
</div>
      <div class="box2">
            <!-- InstanceBeginEditable name="content" -->
            <div class="graybar"><img src="images/headings/register.gif" alt="corporate client image"></div>
            <p>Welcome to connecting London's registration page. Please fill in the entire form below to register with us. All fields in <b>bold</b> are mandatory.</p>  
            
            <form runat="server">
<table width="auto"  border="0" align="left" cellpadding="5" cellspacing="0">
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Title:</b></div></td>
    <td bgcolor="#F7F7F7"><div align="left">
      <input name="text" type="text" id="title" value="" runat="server">
    </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=title
            ErrorMessage=""> * </asp:RequiredFieldValidator>
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>First Name:</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="first_name" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=first_name
            ErrorMessage=""> * </asp:RequiredFieldValidator>
    </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Last Name:</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="last_name" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=last_name
            ErrorMessage=""> * </asp:RequiredFieldValidator>
       </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">Company Name:</div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="company_name" value="" runat="server">
          </div></td>
    <td>
       <div align="left"></div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Address Number/Name:</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="house_number_name" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=house_number_name
            ErrorMessage=""> * </asp:RequiredFieldValidator>
        </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Street</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="street" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=street
            ErrorMessage=""> * </asp:RequiredFieldValidator>
        </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Address 1:</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="address1" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=address1
            ErrorMessage=""> * </asp:RequiredFieldValidator>
        </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">Address 2:</div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="address2" value="" runat="server">
          </div></td>
    <td>
        <div align="left"></div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Town:</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="town" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=town
            ErrorMessage=""> * </asp:RequiredFieldValidator>
        </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>PostCode:</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="postcode" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=postcode
            ErrorMessage=""> * </asp:RequiredFieldValidator>
        </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Telephone:</b></div></td>
    <td bgcolor="#F7F7F7">  
        <div align="left">
          <input type="text" ID="telephone" value="" runat="server">
          </div></td>
            
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=telephone
            ErrorMessage=""> * </asp:RequiredFieldValidator>
                    
                  <asp:RegularExpressionValidator runat=server display=dynamic
            ControlToValidate="telephone"
            ErrorMessage="Tel must be 8 12 nonblank characters."
            ValidationExpression="[^\s]{4,12}"/>            
 

     </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">Fax Number:</div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="fax" value="" runat="server">
          </div></td>
    <td>
       <div align="left"></div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Email Address</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="text" ID="email" value="" runat="server">
          </div></td>
    <td>
       <div align="left"><asp:RegularExpressionValidator id="valRegEx" runat="server"
    ControlToValidate="email"
    ValidationExpression=".*@.*\..*"
    ErrorMessage="Your entry is not a valid e-mail address."
    display="dynamic">*
</asp:RegularExpressionValidator></div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right"><b>Password:</b></div></td>
    <td bgcolor="#F7F7F7">
        <div align="left">
          <input type="password" ID="pass" value="" runat="server">
          </div></td>
    <td><div align="left">
      <asp:RequiredFieldValidator runat=server
            ControlToValidate=pass
            ErrorMessage=""> * </asp:RequiredFieldValidator>
            
                  
                              
       
     </div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">Re-type Password</div></td>
    <td bgcolor="#F7F7F7"><div align="left">
      <input type="password" ID="passcheck" value="" runat="server">
    </div></td>
    <td><div align="left">
      <asp:CompareValidator runat=server
            controltovalidate=pass
            controltocompare=passcheck
            errormessage="Passwords do not match." />    
</div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">Web Address:</div></td>
    <td bgcolor="#F7F7F7">  
        <div align="left">
          <input type="text" ID="web_address" value="" runat="server">
          </div></td>
    <td>
      <div align="left"></div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">Business Sector:</div></td>
    <td bgcolor="#F7F7F7">      
        <div align="left">
            <select id="sector" runat="server">
                                <option value="None Selected">Select</option>
                      <option value="Automotive">Automotive</option>
                      <option value="Computers">Computers</option>  
                      <option value="Construction">Construction</option>
                              <option value="Consumer Goods">Consumer Goods</option>
                              <option value="Education">Education</option>
                              <option value="Electronics">Electronics</option>
                              <option value="Entertainment">Entertainment</option>
                              <option value="Financial Institution">Financial Institution</option>
                              <option value="Insurance">/Insurance</option>
                              <option value="Other">/Other</option>
                              <option value="Government">Government</option>
                              <option value="Military">Military</option>
                              <option value="Public Sector">Public Sector</option>
                              <option value="Hospitality">Hospitality</option>
                              <option value="Recreation">Recreation</option>
                              <option value="Leisure Industry">Leisure Industry</option>
                              <option value="Manugacturer">Manugacturer</option>
                              <option value="Media">Media</option>
                              <option value="Medical">Medical</option>
                              <option value="Health Services">Health Services</option>
                              <option value="Pharmaceuticals">Pharmaceuticals</option>
                              <option value="Professional Services">Professional Services</option>
                              <option value="Publishers">Publishers</option>
                              <option value="Retail">Retail</option>
                              <option value="Telecommunications">Telecommunications</option>
                              <option value="Travel">Travel</option>
                              <option value="Transportation">Computers</option>
            </select>
          </div></td>
    <td>
      <div align="left"></div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">No. Employees:</div></td>
    <td bgcolor="#F7F7F7">    
        <div align="left">
            <select id="no_employees" runat="server">
                                <option value="None Selected">Select</option>
                      <option>1-10</option>
                      <option>11-25</option>  
                      <option>26-50</option>  
                      <option>50+</option>  
            </select>
          </div></td>
    <td>
      <div align="left"></div></td>
  </tr>
  <tr>
    <td bgcolor="#F7F7F7"><div align="right">How did you hear about us?</div></td>
    <td bgcolor="#F7F7F7">        
        <div align="left">
            <select id="hear_about_us" runat="server">
                                <option value="None Selected">Select</option>
                      <option>Colour Pages</option>
                      <option>Direct Mail</option>  
                      <option>Internet</option>  
                      <option>Referral</option>  
                      <option>Yellow Pages</option>  
                      <option>Yell.com</option>
                      <option>Other</option>  
            </select>
          </div></td>
    <td>
      <div align="left"></div></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#F7F7F7">Please call me to set-up the EPA (Email Protection Agency) FREE 15 day trial.
            <asp:CheckBox ID="callback" runat="server" Checked="true" />
        </td>
    <td></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#F7F7F7">
    <td></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#F7F7F7">Tick here to keep you up to date with the latest IT devleopments. Get more out of your existing technologies, find out about essential resources, new technology guides & time saving hints to help you get more done, cost effectively. Please untick the box if you do not want to subscribe.
<asp:CheckBox ID="keep_todate" runat="server" Checked="true" /></td>
    <td></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td colspan="3"><div align="center">
            <input type="submit" OnServerClick="Submit_Click" value="Submit" runat="server">
            <span class="style6">only submit once
            </span> </div></td>
    </tr>
</table>

</form>

            <!-- InstanceEndEditable --></div>
</div>
      <div class="box4">
              For more information call:<br>
            <b>Gary Howells on 020 7591 5455 or Robert Saleh on 020 7591 5454<br></b>
             or <a href="mailto:email sales@connectinglondon.com ">email sales@connectinglondon.com </a></div>
      </td>
            <td style="width: 5%; background: #EEE; border-left: 1px solid #AAA;">&nbsp;</td>
      </tr>
</table>
</body>
<!-- InstanceEnd --></html>

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-09-07 at 04:17:25ID21121329
Tags

postcode

,

requiredfieldvalidator

,

dim

Topic

Programming for ASP.NET

Participating Experts
2
Points
500
Comments
4

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Stylesheets
    I am using LINK tag to my stylesheets. All works great in IE 4 but not in Navigator 4. My code is <LINK REL=STYLESHEET TYPE="text/css" HREF="style/mkt.css"> and my stylesheet is BODY {font: 12 pt Arial} H1 {font: 22 pt Times; color: navy; text-a...
  2. Div/CSS newbie
    I have an image of a map of North America, and I want to place pictures at specific locations that have hyperlinks and alt text. I created a test HTML page and it works with no problems at all. Here is my HTML code: <img src="h:\north america.jpg" id="map...
  3. Need the content of an iframe to use the parent stylesheet
    OK, I have a page served from a content management system that embeds output from my JSP app server using an iframe. I want the JSP generated page to use the same stylesheet as the parent page. Parent code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: pigmentartsPosted on 2004-09-07 at 04:21:13ID: 11995554

do i need some sort of if statment at this link that will know if it has been checked or not.

    If request.form("email") <> ""
      
        Dim mail As New MailMessage
        mail.From = request.form ("email")
        mail.To = "glynj@pcdi.co.uk"
        mail.Subject = "Request for call back"
        mail.Body = "User submitted a request for call back using the online registration form." & "<br>" & "Client Name: " & request.Form("first_name") & " " & request.Form("last_name") & "<br>" & "Telephone number recorded: " & request.form ("telephone") & "<br> Email powered by webwordz"
        mail.BodyFormat = MailFormat.Html
               SmtpMail.SmtpServer = "10.0.0.2"
            SmtpMail.Send(mail)
            
            
            Dim mail2 As New MailMessage
        mail2.From = "somewhere"
        mail2.To = request.Form("email")
        mail2.Subject = "Thank you for registering"
        mail2.Body = "User submitted a request for call back using the online registration form."
        mail2.BodyFormat = MailFormat.Html
               SmtpMail.SmtpServer = "10.0.0.2"
            SmtpMail.Send(mail2)
             
    End If

 

by: jetforcePosted on 2004-09-07 at 04:32:21ID: 11995627

you say you need to submit if only the check box is selected, as your checkbox are asp controls
 you need the following code
  If request.form("email") <> "" and callback.checked then
 
      Dim mail As New MailMessage
        mail.From = request.form ("email")
        mail.To = "glynj@pcdi.co.uk"
        mail.Subject = "Request for call back"
        mail.Body = "User submitted a request for call back using the online registration form." & "<br>" & "Client Name: " & request.Form("first_name") & " " & request.Form("last_name") & "<br>" & "Telephone number recorded: " & request.form ("telephone") & "<br> Email powered by webwordz"
        mail.BodyFormat = MailFormat.Html
             SmtpMail.SmtpServer = "10.0.0.2"
           SmtpMail.Send(mail)
         
         
          Dim mail2 As New MailMessage
        mail2.From = "somewhere"
        mail2.To = request.Form("email")
        mail2.Subject = "Thank you for registering"
        mail2.Body = "User submitted a request for call back using the online registration form."
        mail2.BodyFormat = MailFormat.Html
        SmtpMail.SmtpServer = "10.0.0.2"
         SmtpMail.Send(mail2)

end if

 

by: AerosSagaPosted on 2004-09-07 at 05:38:39ID: 11996104

It would really be smarter to have a required field validator for the email that is set to disabled.  Then when the user checks the checkbox it would enable the required field validator as well as the regular expression validator you already have.  That way on submit click all you have to do is look for is callback.checked to decide whether or not to send email.  The above post will work, its just not the best way to do it.

Regards,

Aeros

 

by: pigmentartsPosted on 2004-09-07 at 05:43:35ID: 11996140

thank you, simple just did not think, was over thinking it.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...