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 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Frustrating email/aspID question

    I am struggling to get this script to work the way I want. It is supposed to "email this recipe to a friend"
    It works except it doesn't include the actual recipe ID (?recipeID=134) so what I get as an address is this:

    http://www.recipesplus.ca/recipe.asp (which is always recipe #1)

    What I want to do is have it email the specific recipe (including the asp recipe ID) like this:

    http://www.recipesplus.ca/recipe.asp?recipeID=134

    Thanks very much if you can help,

    kovalik

    Here's the script:

    <SCRIPT>
    function Mailit(form) {
    window.location.href=("mailto:" + form.address.value + "?subject=A web page to see&body=I found this web page at " + window.location.href + window.location.search + ", which I thought you might like to see.")
    return false;
    }
    </SCRIPT>


    <FORM name="Recom" onsubmit="return Mailit(Recom)">
    <TABLE>
    <TR><TD>Recommend this Web page to a friend</TD></TR>
    <TR><TD><INPUT type="text" name="address" size="35" value="Enter Email Address">
    <INPUT type="button" name="Button" onclick="Mailit(this.form)" value="Send"></TD></TR>
    </TABLE>
    </FORM>



  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    perhaps retrieve the href Before instantiating the process to change it....like this...
    Code:
    function Mailit(form) { 
    var currUrl = top.location.href;
    window.location.href=("mailto:" + form.address.value + "?subject=A web page to see&body=I found this web page at " + currUrl + ", which I thought you might like to see.") 
    return false; 
    }

  • #3
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    mailto: is extraordinarily unreliable. you're better off using a server-side script.

    this:
    window.location.href + window.location.search ,
    is repetitive. location.href already has location.search in it.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy thanks

    I struggle with scripting, I appreciate all your help. Can you point me in the direction I need to go. As in, what kind of server side script I would require? Ill try and go from there.

    Thanks for your time.

    kovalik


  •  

    Posting Permissions

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