View Single Post
Old 12-29-2012, 06:09 PM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
this is untested, but as far as I am aware, if everybody is using IE it can be done. In the below, you need to give each checkbox which refers to a file a class of "doc" and a value which corresponds to the full path to the filename. I don't know if filenames with spaces will work - you may have to escape the whole string. I don't have outlook so can't test it, but it seems like it would be something like this:

Code:
<body>
<div class="col one_fourth gallery_box"> 
<a href="images/docs/POP_Form.jpg" 
rel="lightbox[docs]"><img src="images/docs/POP_Form.jpg" 
alt="" width="74" height="95" class="image_frame"/></a>
 <h5>Student Payment Option </h5>
 <h5>Policy Agreement (POP Form) </h5>
 <h5><font color="#990000"><a href="docs/POP Form.pdf" target="_blank">
<strong>Click here for the PDF</strong></a></font></h5>
 <h5> <span id="sprycheckbox3">
  <input type="checkbox" name="pop_form" id="pop_form" class="doc" value="http://192.168.0.461:87/docs/POP Form.pdf" tabindex="40" />
    <label for="pop_form">Send this form in an email</label>
    <span class="checkboxRequiredMsg">Please make a selection.</span></span></h5>
</div>
<input type="button" value="send email" onclick="sendMail()"/>
<script type='text/javascript'>
function sendMail(){
  objOutlookExpress = new ActiveXObject("Outlook.Application");
  objOutlookMsg = objOutlookExpress.CreateItem(0)
  objOutlookMsg.To = "";//add email address here
  objOutlookMsg.Subject = "your documents";
  objOutlookMsg.HTMLBody = "Here are the documents you requested";
  var inps=document.getElementsByTagName("input");
    for (var i = 0; i < inps.length; i++) {
  if(inps[i].className="doc"&&inps[i].checked){
  objOutlookMsg.Attachments.Add(inps[i].value);
			}
	}
}
</script>
</body>

Last edited by xelawho; 12-29-2012 at 06:16 PM..
xelawho is offline   Reply With Quote