Closed Thread Icon

Topic awaiting preservation: JavaScript dynamic links (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8524" title="Pages that link to Topic awaiting preservation: JavaScript dynamic links (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: JavaScript dynamic links <span class="small">(Page 1 of 1)</span>\

 
Dufty
Paranoid (IV) Inmate

From: Where I'm from isn't where I'm at!
Insane since: Jun 2002

posted posted 02-11-2003 15:13

Hey hey!

Now I feel particularly stupid posting this, but I have to be honest, my brain feels as though it's shrunk to the size of a pea and is rattling around up there.

It's a fairly straightforward problem (haahahaha - I thought it was anyway):

I have this function:

code:
function mergeURL(x) { 
with (document.forms["myForm"])
{

var setURL = passURL.value
var setSession = MonitoringRefID.value
var mailURL = setURL + setSession
}
}



Which takes the values from two form elements, and joins them in a variable.
Simple enough so far.

passURL is a textfield, containing a URL which ends thus: blahblahurl.asp?MonitoringID=
MonitoringRefID is also a textfield, dynamicaly populated by another function, and containg the unique identifyer which sits after the URL

Together they make a complete URL: http://blahblahurl.asp?MonitoringID=xxyyzz

This all works fine, so now I want to create a dynamic MAILTO link, which adds the complete URL in the body of the message. And here's where I fall flat on my behind.
I've tried the method below, but I just can't work out / remember where the delimiters go, and how to separate my html from my javascript...

Can someone please point out where I'm going wrong?

code:
<script>
document.write("<a href='MAILTO:Enter recipient name here?subject=monitoring%20session%20details&body=' + mailURL + ' onMouseOver=mergeURL(1)'>Send session link</a>")
</script>



Meanwhile, I'm off to break Google.
Seems the more I search, the more confused I become. *Sigh*

My head hurts.

Thanks again
Dufty

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 02-11-2003 17:45

ahh bit too much work. You don't need to write out the link you just need this.

<a href="javascript: location.href = 'mailto:' + mailurl" onMouseOver="mergeURL()">Send Session Link</a>

(make sure just in case to have mailurl set once at least to a default in your head script)



.:[ Never resist a perfect moment ]:.

Dufty
Paranoid (IV) Inmate

From: Where I'm from isn't where I'm at!
Insane since: Jun 2002

posted posted 02-11-2003 18:26

Thanks bitdamaged, I'll give it a whirl.

« BackwardsOnwards »

Show Forum Drop Down Menu