Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2003
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    email subject composed

    I’m just beginning with JS and am already fanatic. But due to lack of experience I have a problem with pre-defining the subjectrule in an email.


    What I’m trying to do is the following ……..

    In html you use this code to open an e-mail with predefined subject. (The choise to whom is open, because here I’ll use the selection that is provided by outlook once the e-mail opens. I make a selection out of an adressbook.).

    <a href="mailto:?subject= ???????????????????????????????">IMAGE</a>


    ??????????????????????????????? is composed of the following elements:

    XXXXXX - and ?????? ?????? and - MMMMMMMMMMM ( ).

    XXXXXX - and - MMMMMMMMMMM ( ). are already in the subject rule.

    XXXXXX - at the beginning of the subjectrule and - MMMMMMMMMMM ( ) at the end.

    ?????? ?????? is a selection out of a list (can be one word or a sentence). This selection is enclosed by XXXXXX - and - MMMMMMMMMMM ( ) .


    What should I do so that everything comes together when the e-mail opens to indicate the recipient?



    Something like following code (?????)

    <a href="mailto:?subject= XXXXXX - {select a word or sentence out of a list} - MMMMMMMMMMM ( ) ">IMAGE</a>

    Which script should I use to select a word or sentence out of a list and when selected, this selection should place itself between the 2 already defined XXXXXX - and - MMMMMMMMMMM ().

    Should it be better to use PHP to obtain that list from the server and then use JavaScript? Or is this something stupid to mention???

    Is there please somebody who can help me??

    Thanks a lot in advance.

    Jef Gees
    e-mail: jefgees@westbrabant.net

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What you are trying to acheive ideally needs to be done by reloading the page so that the values can be hard-coded into the HTML at run time. Having said that, you can achieve a similar effect using DHTML to write your mailto link into a <div> without reloading the page. Bear in mind that this will only work in browsers such as IE5, NS6 and upwards. You could also add a little patch to get it to work in IE4 if needed. Have a play with my example, I hope it furthers your understanding.


    <html>
    <head>
    <title>Changing a mailto: link using DHTML</title>
    <script>
    <!--
    function changeMailto(i){
    mailtoString = "<a href=\"mailto:person@domain.com?subject=XXXXXX - "+i+" - MMMMMMMMMMM ( )\">IMAGE</a>";
    document.getElementById('test').innerHTML = mailtoString;
    }
    -->
    </script>
    </head>
    <body>

    <form>
    <select onchange="changeMailto(this.options[this.selectedIndex].value)">
    <option value="apples">apples</option>
    <option value="oranges">oranges</option>
    <option value="bananas">bananas</option>
    </select>
    </form>

    <br />

    <div name="test" id="test"></div>

    </body>
    </html>
    As easy as 3.1415926535897932384626433832795028841


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •