PDA

View Full Version : I'm stumped...email/asp question


kovalik
08-13-2002, 03:00 PM
Hi,

I am using this code to "email this recipe to a friend". The code itself works great. My problem is that the pages I want to use it on are asp pages. Example:

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

Does anyone know how to make this code recognize the specific asp address?

<SCRIPT>
function Mailit(form) {
document.location.href=("mailto:" + form.address.value + "?subject=A web page to see&body=I found this web page at " + document.location.href + ", 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>


Thanks very much,

kovalik :)

beetle
08-13-2002, 04:14 PM
I don't understand. What isn't working?

kovalik
08-13-2002, 04:54 PM
The code 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:

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

Thanks very much if you can help,

kovalik

beetle
08-13-2002, 05:08 PM
Try appending the value of window.location.search to the string

kovalik
08-13-2002, 05:21 PM
Sorry, I'm struggling to pic up java. Could you be more specific? Usually I look for tutorials, but this topic was hard to find.

Thanks again,

Georgia

beetle
08-13-2002, 05:27 PM
Well, it would be like this...<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>As you can see, I also recommend using window instead of document and better not forget those semicolons! :D

kovalik
08-13-2002, 05:31 PM
I wasn't sure whether I should reply (thereby pushing my subject to the top again) but I just wanted to say thank you very much for your time. I really appreciate it.

kovalik :thumbsup: