Jump to content

Javascript Hyperlink


cybergost1

Recommended Posts

i Have an email form that is being created in a function of javascript. I posted what i was tryign to do below. I get get the email to pop up like i need to when the function is called but the link always comes up as plain text. I have tried several different ways to input the link but i just can't do it for some reason. I know its something stupid. thank you in advance for any help on this. There is more to this form i just cut and pasted what i was having issues with.

<script>function updateDescription2 (frm){var currentdate = new Date()    var Template = "";    var vald="";    var statg="";    var statg1="";	var frm = document.getElementsByTagName("form")[0];if (frm.templateg.checked == true){core= "%0A"}else core = "\r\n"if (frm.templateg.checked == true && window.event.srcElement == frm.onscreenform){Template += "1: Navigate to" + <a href="link here.com">Link</a> + core;Template += "2: If prompted with a download warning, have the user click Open or OK" + core;Template += "3: Have the user click START within the tool " + core;Template += "4: When the Reset Successful dialog appears, click OK and then click Close" + core;}if (frm.templateg.checked == true && window.event.srcElement == frm.onscreenform){        //this creates the email, it is up to the sender to hit send        var eml= statg ;         var bod="&body="+Template;        var subj="?subject= link toFix and instructions on how to run";         location.href="mailto:"+eml+subj+bod; }}</SCRIPT><table>				<tr>		<td>			<input type="button" name="test form" value="testform" onClick="updateDescription2();return false;">		</td>	</tr></table>

Link to comment
Share on other sites

This line has some messed up quotes:Template += "1: Navigate to" + <a href="link here.com">Link</a> + core;Should be:Template += "1: Navigate to <a href=\"link here.com\">Link</a>" + core;When you set the email:var eml= statg ; It looks like the statg variable is empty. If that's the case the link won't work right. Since you're packing everything into a URL, you might need to use the escape function to make sure the data goes through right. var bod="&body="+escape(Template); var subj="?subject=" + escape("link toFix and instructions on how to run");

Link to comment
Share on other sites

  • 2 weeks later...

i tried that but it does not like it. it gives a error that it is an invaild command.Will it make a difference if the link i am trying to create in the email is acutaly an "\\servername\app.exe"i tried to put a normal web address too see if it was what i was entering but it would work with that.Is there a different way of input a link to a exe on a server than what i was trying to do or suggested. since i didnt expalin that the first time around i assumed it would be the same.editoriginally i did putTemplate += "1: Navigate to <a href="link here.com">Link</a>" + core;i even triedTemplate += "1: Navigate to <a href='link here.com'>Link</a>" + core;but it didnt show up as a link it showed up as text only

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...