JavaScript - Mailto Link
Does anyone know of a safe mailto link using JavaScript?
Similar TutorialsI have a question and I'm hoping someone may have some suggestions on how to solve. I found a script on this forum that does almost what I want from this thread: http://codingforums.com/showthread.php?t=184011 (thank you Philip M!) Instead of a dropdown, I'd like to have a list of names using check boxes, so that you have the option to send an email to one or all of the people. When you choose your selections and click submit, an outlook email will pop up with your selections in the to: field. Is this possible? Here's the solutuin using a drop down, this works (and works well), but doesn't quite do what I need : <form name="Contact_Us" id="contact" method="post" enctype="text/plain" onsubmit = "getEml()"> <fieldset id="selection"> Who would you would like to email: <select name = "sel"> <option value="email1@email.com" >email 1</option> <option value="email2@email.com" >email 2</option> <option value="email3@email.com" >email 3</option> </select> <input type = "submit" value = "Submit the form"> </form> <script type = "text/javascript"> function getEml() { var emailaddress = document.Contact_Us.sel.value; window.location = "mailto:" + emailaddress; } </script> Is there a way to use checkboxes but to do the same thing? <INPUT TYPE=CHECKBOX NAME="name1@email.com">name 1<BR> <INPUT TYPE=CHECKBOX NAME="name2@email.com">name 2<BR> <INPUT TYPE=CHECKBOX NAME="name3@email.com">name 3<BR> Attached is the code. It does open the email but does not send any information. Can someone please assist. Code: <!-- Table 2 for the Content --> <form name="orders" onsubmit="return confirmSubmit()" onreset="return window.confirm('Are you sure you want to reset your Orders.'); " action="mailto:lynette@sayorkies.co.za" method="post" enctype="text/plain"> Code: // Function to Confirm certain conditions and confirm to proceed with order function confirmSubmit() { var itemsOrdered = true; if (document.forms[2].totalExcl.value == 0 || document.forms[2].delivery.value == 0) { itemsOrdered = false; } if(itemsOrdered != true) { window.alert("You have not chosen any products to purchase or No Delivery Option selected."); return false; } var submitOrder = window.confirm("Are you sure you want to place the order?"); if(submitOrder == true) return true; return false; } // Function to calculate order value function calculateValue(orders) { var orderValue = 0; // Run through all the product fields for(var i = 0; i < orders.elements.length; ++i) { // Get the current field var formField = orders.elements[i]; // Get the fields name var formName = formField.name; // Is it a "product" field? if (formName.substring(0,4) == "prod") { // Items price extracted from name var itemPrice = parseFloat(formName.substring(formName.lastIndexOf("_") + 1)); // Get the Quantity var itemQuantity = parseInt(formField.value); // Update the OrderValue if(itemQuantity >= 0) { orderValue += itemQuantity * itemPrice; } } } // Display the totals orders.totalExcl.value = "R " + orderValue.toLocaleString(); // function to calculate VAT at 15% as required and total inclusive. function calcTotals(oValue) { var vat = oValue * .15; var totalIncluding = oValue + vat; var tDelivery = Number( orders.delivery.value.substring(2) ); var theTotalOrder = totalIncluding + tDelivery; orders.vat.value = "R " + vat.toLocaleString(); orders.totalIncl.value = "R " + totalIncluding.toLocaleString(); orders.totalOrder.value = "R " + theTotalOrder.toLocaleString(); } return calcTotals(orderValue); } I have created this form. I would like to use javascript to mail the form to the selected email from the selection list when the submit button is pressed. could anyone help with this? <form name="Contact Us" id="contact" action="mailto:" method="post"> <fieldset id="selection"> Who would you like to email: <select> <option value="email1" >email1</option> <option value="email2" >email2</option> <option value="email3">email3</option> </select> <fieldset id="Name" > Name <input type="text" id="firstname" name="firstname"> <input type="text" id="email" name="email"> </fieldset> <fieldset id="question"> Comments and Questions <input type="text" id="comment" name="comment" style="width: 500; height: 300"> </fieldset> </form> Hi guys, I'm looking for a way i can set some of the mailto form data - mainly the full name and holiday start date into the subject line of the email. this is the code for my form: Code: <html> <head> <body bgcolor="#DCDCDC"> <font size="3" face="tahoma" color="#000000"> <form action="MAILTO:email@email.co.uk?subject=Holiday Request" method="post" enctype="text/plain" font-weight: bold; size="10" maxlength="30"> <u><b>Holiday Request Form</b></u> <br /><br /> First Name: <input type="text" name="first-name" /> <br /><br /> Last Name: <input type="text" name="last-name" /> <br /><br /> Holiday Type: <select name = "Holiday Type"> <option value="new holiday">New Holiday</option> <option value="amend holiday">Amend Holiday</option> <option value="delete holiday">Delete Holiday</option> </select> <br /><br /> Start Holiday: <select name = "Start Day"> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> / <select name = "Start Month"> <option value="january">Jan</option> <option value="febuary">Feb</option> <option value="march">Mar</option> <option value="april">Apr</option> <option value="may">May</option> <option value="june">Jun</option> <option value="july">Jul</option> <option value="august">Aug</option> <option value="september">Sep</option> <option value="october">Oct</option> <option value="november">Nov</option> <option value="december">Dec</option> </select> / <select name = "Start Year"> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2013</option> </select> <br /><br /> End Holiday: <select name "End Day"> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> / <select name = "End Month"> <option value="january">Jan</option> <option value="febuary">Feb</option> <option value="march">Mar</option> <option value="april">Apr</option> <option value="may">May</option> <option value="june">Jun</option> <option value="july">Jul</option> <option value="august">Aug</option> <option value="september">Sep</option> <option value="october">Oct</option> <option value="november">Nov</option> <option value="december">Dec</option> </select> / <select name = "End Year"> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2013</option> </select> <br /><br /> Total Hours Required: <input type="text" name="total-hours" size="6"/> <br /><br /> Notes Box: <br /> <textarea name="Additional Info" rows="5" cols="40"> Enter here any additional information that may be required. </textarea> <br /><br /> Half Day Tickbox: <input type="checkbox" name="half-day" value="half-day"/> <br /><br /> Start Shift: <select name = "Start Shift Hours"> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select> : <select name = "Start Shift Minutes"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <br /><br /> End Shift: <select name = "End Shift Hours"> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select> : <select name = "End Shift Minutes"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <br /><br /> Lunch Start: <select name = "Lunch Start Hours"> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select> : <select name = "Lunch Start Minutes"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <br /><br /> Lunch End: <select name = "Lunch End Hours"> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select> : <select name = "Lunch End Minutes"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <br /><br /> Holiday Start Time: <select name = "Holiday Start Hours"> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select> : <select name = "Holiday Start Minutes"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <br /><br /> Holiday End Time: <select name = "Holiday End Hours"> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select> : <select name = "Holiday End Minutes"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <br /><br /> <input type="submit" value="Send"> </form> </font> </body> </head> </html> Any help will be appreciated. Thanks, Craig I'm looking for a simple javascript that can fill in the subject of an email message with whatever is in the title tags of the page they're on and also to include the link the the page in the body. [CODE] <a href="mailto:e@o.com?subject=&body=http://www.o.htm" title="Question"> [CODE] Thanks! I'm working on a technical document that has a glossary section. When I use a technical term, I link to its definition in the glossary then provide a return link to return the user to whence they came. But if I use that same term again, and if I want to link it to the glossary, I need to duplicate the glossary entry in order to provide a return link that returns them to the right place. Is there some way I could link them to the glossary and embed a unique return link in the link to the glossary?
I've been using this slidehsow but each time I click on a link (Newsflash) it goes to yahoo.com, even though each link goes to a different website, it looks like the last link of the last slidehsow is the one which controls all the slidehsow links link of slidshow as you can see from the code each link for each slidehsow should go to a diffrent website. Code: <div class="lof-main-outer"> <ul class="lof-main-wapper"> <li> <img src="images/791902news3.jpg" title="Newsflash 2" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 2" href="http://www.google.com">Newsflash 2</a></h3> <p>The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...</p> </div> </li> <li> <img src="images/435576news10.jpg" title="Newsflash 1" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 1" href="http://www.gmx.com">Newsflash 1</a></h3> <p>Joomla! makes it easy to launch a Web site of any kind. Whether you want a brochure site or you are...</p> </div> </li> <li> <img src="images/641906img1.jpg" title="Newsflash 3" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 3" href="www.godaddy.com">Newsflash 3</a></h3> <p>With a library of thousands of free Extensions, you can add what you need as your site grows. Don't...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.flickr.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.intel.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> <li> <img src="images/416719news7.jpg" title="Newsflash 5" height="300" width="900"> <div class="lof-main-item-desc"> <h3><a target="_parent" title="Newsflash 5" href="http://www.yahoo.com">Newsflash 5</a></h3> <p>Joomla! 1.5 - 'Experience the Freedom'!. It has never been easier to create your own dynamic Web...</p> </div> </li> </ul> </div> I know you may think... why is he doing this? There is a reason, this is just the simplified version. Code: <a href="URL TO COPY" id="COPYME">Next</a> <a href="COPIED URL HERE VIA JAVASCRIPT" >Next</a> Hi, I have a flash code, I need to add alink in this code, but I don't know how I can. This is the link I want to add " www.baligim.com" Thanks. Code: Code: <div id="wb_Flash1" style="margin:0;padding:0;position:absolute;width:300px;height:60px;text-align:left;z-index:0;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" <param name="movie" value="http://www.baligim.com/download/reklam-banner.swf"> <embed src="http://www.baligim.com/download/reklam-banner.swf" width="300" height="60"> </embed> </object></div> . Hello and good morning... I am a locking for a script, so i can open this: <div class="topprofile"><a href="index.php?side=editprofile#editpw">Edit password</div> After i have push in this, "topprofile" button, i want to have link like this: http://localhost/index.php?side=editprofile#editpw Can you plaese help me with this one? How can I let link page open using IE? for example, I open a webpage using firefox or chrome/opera/safari. when I click the link, open the link using IE <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head2" runat="server"> </head> <body> <a href="#" onClick="window.showModalDialog ('http://www.google.ca','','width=600,height=600','screenx=200','screeny=200')"><img src="images/benemanc-01th.jpg" alt="img-01" width="125" height="155" class="thumb" style="display:inline"></a> </body> </html> Many thanks T I can't figure out why this isn't working. I'm calling a function from a link in an iFrame, but I want a second function (which builds upon the first) to be called a second after the first one. So I have this: <a href="javascriptarent.func1();setTimeout('parent.func2', 1000)">Click here</a> setTimeout works when it's the only function I'm calling, but it appears that having the two together erases the delayed function. Thoughts? ~gyz Below is a bulleted array, as you can see I inserted the sample url tag but it's not working, is that the wrong location? Code: $catArr = array( 0=>array("category"=>"Banners", "id"=>217, "nav1"=>"Events & Themes", "nav2"=>"", "headerText"=>"<h2>Templates for Full Color Banners</h2><ul><li>Choose your Banner by Event or Theme</li><li>Select a template and make it your own!</li><li>Text Position and Color are for demonstration only.<br/>You may move or change them as needed.</li><br><br> 'url'=>"http://www.google.com", back to main banner page</ul>"), Hi all, Trying to something i guess is pretty basic but i cant seem to get it working. I have a page with an iframe name="grid" and on that page i am also running a mootools script which toggles a pannel. The javascript for the pannel is: Code: <script type="text/javascript"> window.addEvent('domready', function(){ var mySlide = new Fx.Slide('top-panel'); $('toggle').addEvent('click', function(e){ e = new Event(e); mySlide.toggle(); e.stop(); }); }); </script> so this link opens the pannel Code: <a href="#" id="toggle">Show Panel</a> However, i want to make a it so that one link can both call a page in the iframe AND toggle the pannel. I tried: Code: <a href="page_to_call.htm" target="grid" id="toggle">Show panel and call page in iframe</a> but no joy. I want more than one link to be able to do this (calling different pages to the iframe and each one toggling the pannel) Can anyone help? Thanks loads in advance for any reply. All, If I want to do the following: Code: result="<h2><strong>Home</strong></h2>The site idea is pretty simple. There are creeps everywhere and we want to point them out. Killing time during work or school never hurt anyone either. Help us out and give your friends something to enjoy. Make sure to submit your <a href="testurl.html">Test</a>"; How can I escape the URL because after that I want to do: Code: document.getElementById('showdata').innerHTML = result; All, I have a page that has some checkboxes in it. I have the following function for that: Code: function checkbeforesubmit(field) { for (var i = 0; i < field.length; i++){ if(field[i].checked){ // if a field is checked form is submitted alert("You have checkboxes that are selected. Add the photos before you go to the next set of pictures!"); return false; } } return true; // if no fields are checked form not submitted } I then a link to go to the next page and I want to check to see if any checkboxes are selected before I go to the next page. I try and check this by doing this: Code: onClick="checkbeforesubmit(document.photos.elements['picbigid[]'])" It does the check and says that a checkbox is selected but will still go to the next page anyway. How can I stop it from going to the next page? Thanks! Hello, I've been reading my JS book, have done a 'Degrees Converter' which converts fahrenheit into centigrade. There is a prompt box which automatically loads when the website is loaded. I am pressuming this is because I have my script in the body. I have a question if anybody could possibly help me out. How do I get my script as a link? To explain a little better, I wanted to put the words 'Degrees Converter' onto my page(as a link), so that when people click the link, it loads up the prompt box. I'm very new to JavaScript, so if anyone could help me out it would be a great help. Thank you very much. |