JavaScript - How Get A Mailto:subject To Equal What Is In The Title Tags Of The Page?
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! Similar TutorialsHi 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 have a javascript that loads images on the page based on the date you select from a drop down menu. So the images are displayed dynamically, however they are numbered 1 through 20. Is there a way I can add a title tag to the images that will display on mouseover? Here's the page I am working on. I want to add title tags to the six images on the right side of the page. They change based on the date selected. webpage Thanks. One my website its one index page, putting in content depending on the link (ie ?page=xxxxx) and from that it generats the page name, (Page name - MySite). I also have an AJAX search form working on keyup (kinda like google autosearch). I want it so when i start typing there it changes the title to Search - MySite. Then when its empty revert to what ever it was before. Could someone gimmie a hand doing this? I already have the AJAX coding for the search bar so i can post that if iy would help more. EDIT: Also i need to check if its on the homepage or not, and if not load the homepage (currently done by php include), does javascript have an equivelant of php's include? I found this code in another thread... basically, I need to be able to display a certain image based on the page's title... for instance if the title is: Lotus 7, I need image lotus.jpg to display in an element on the page, however, if the title is Bodhi 9, I need image bodhi.jpg to display in the same element. Can someone help me implement this code? Code: var imgs = new Array(); imgs[0] = new Array(); imgs[0][0] = "Research"; imgs[0][1] = "bluetabs_01"; imgs[0][2] = "greentabs_01.gif"; imgs[1] = new Array(); imgs[1][0] = "Information" imgs[1][1] = "bluetabs_02"; imgs[1][2] = "greentabs_02.gif"; Code: var title = document.title; for (var i=0;i<imgs.length;i++){ if (title.indexOf(imgs[i][0])!=-1){ document.images[imgs[i][1]].src = imgs[i][2]; break; } } This script isnt working. Im not sure what im doing wrong. forgive me i havent programmed in javascript before. titles.js Code: <script type="text/javascript" language="javascript"> <!--// function random_Title(){ if (parseInt(navigator.appVersion) >= 4) { var num = 3; var rantitle = new Array(num+1); rantitle[1] = "Random Title1"; rantitle[2] = "Random Title1"; rantitle[3] = "Random Title1"; ranNumber = parseInt(num * Math.random() + 1); document.title = rantitle[ranNumber]; } //--> } </script> html page Code: <html> <head> <script type='text/javascript' src='http://www.flashmajic.com/Google/titles.js'></script> <script> document.title = random_Title() ; </script> </head Hi Guys, I want to output my pagetitle in javascript. An idea of syntax? <title> products</title> eg My page title is javascript code outputs... My page title is products no joy with Code: <body> <script TYPE="text/javascript"> document.write(document.title); </script> </body> Thanks How to I use the tipsy (http://onehackoranother.com/projects/jquery/tipsy/) to read from the title tag in the Code: <a href="#", title="Hello<br>World">Hello World</a> From what I can do is to use the tipsy code: Code: $('#example-html').tipsy({html: true }); The final code which I wish to create may look something like the following: Code: for (var i=0; i<10; i++){ document.write("<a href='#', title='Hello<br>" + i + "' class='example-html'> Hello " + i + "</a>"); } Appreciate any help offer Hi, I have some JavaScript that is being used to open a new window and display a PDF file. This is working fine apart from the title of the new window being open. I am using the window.open function and I have set the title of the page using the document.write function (see code below). The code works fine for FF and IE but for some reason Google Chrome just displays 'Untitled - Google Chrome' Code: <body> <a href="javascript:openNewWindow();">Click Here</a> <script type="text/javascript"> function openNewWindow() { var pdfWindow = window.open('', "window", 'resizable=1,scrollbars=0,width=800,height=600'); pdfWindow.document.write('<html><head><title>Window Title</title></head>'); pdfWindow.document .write('<body><iframe src="" id="ifrm" name="ifrm" width="100%" height="100%"></iframe>'); pdfWindow.document.write('</body></html>'); pdfWindow.document.close(); } </script> </body> Note: I have also tried adding - pdfWindow.document.title="Title"; - to the JavaScript, with no luck. Is there anything specific that is required for Chrome or am I just missing something?? Thanks in advance for any help! I have a php file lets say file1.php, that printing a variable, its dynamic numbers output that already always increasing, like private message numbers that coming or others : PHP Code: <?php echo $variable ?> i want to put that variable output, in another files page title, lets say file2.php or file3.html, in the front of the another files page titles, and auto refresh every x seconds, maybe like this : Quote: (1) - another text in the page title after x seconds, get a private message Quote: (2) - another text in the page title after another x seconds, get another private message Quote: (3) - another text in the page title or its ok if just like this, only the variable, without the another text in the page title Quote: (1) please share your knowledge to make it, maybe using javascript, jquery or others This page: http://homepage.ntlworld.com/kayseyc...document2.html seems to indicate that it's possible, but it looks like it also pops up an alert window which would be annoying as hell. Is there a way to, say, once every minute change the title bar text? You see I have a text file of rotating slogans that appear each time you reload a page on my site and someone suggested that having them change even when the page is already open might be fun. I thought I'd look into it and see if it's possible. The site is http://opalcat.com. I don't know enough about javascript to know if this is possible. I am fairly good at implementing and installing other people's code, though, and can usually make minor changes to tweak things. Please let me know if this is a doable thing, and if so, if you'd be willing to help me work it out. Thanks in advance, OpalCat Hi, How I get the images tags from an HTML page with Javascript (SRSc)? Regards FG I am looking to use a similar method as facebook chat does, where it alternates between the original title text and 'friendsName has sent you a message!...' how can I do this ? Hello, I was wondering if it is possible to do something like below using JS. Say I have some hidden text at the top of an HTML page... Code: <div id="text" style="visibility: hidden;">text</> and an empty tag at the bottom of the page. Code: <div id="empty_container"></div> Is there any way JS could grab the content inside #text and move it inside #empty_container when the page loads? Thanks. I have placed the <script></script> in the <head></head> tags and the page will not work. But placing the <script> below the element that the JS works with allows the page to work but thought the correct method to use was place all JS functions inside the <head> tags? here is a link to the folder I am testing this out on. http://www.realistichostings.com/test_booking/ I have named the two files accordingly, test_booking_page-script is in head tags.php test_booking_page-script is outside head tags.php can anyone tell me why the code works outside the head tag but not when i is inside the head tag ? Hi, I am setting up an email form & i would like the subject field to hold multiple values, the forrm will be something like this: Name:Mr A Date: 01/01/01 Reason:Football I want the form to send an email without opening an email client & I would like the subject field to look like this: Subject: Mr A, 01/01/01, Football or Subject Mr A - 01/01/01 - Football Can anyone tell me if this is possible, if if is can you please point me in the right direction. Thanks I am trying to trigger one custom function or another, depending on whether a radio button is checked or not. How can this be done? (I was hoping that "self" would be the ticket, but I think I was barking up the wrong tree.) Code: function toggleFieldsetByRadio(element){ if(SELF.checked){ enable(element); }else{ disable(element); } } How should I do this? I am hoping to use this function with an onchange event. ~ Mo Does anyone know of a safe mailto link using JavaScript?
I 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> |