real quick code snippet for javascript

Status
Not open for further replies.

russ-iha

Ars Praefectus
4,407
Subscriptor
I have a really quick javascript question. I could research it myself, but I don't have the time and was hoping someone could help me out.

Basically, when a hyperlink is clicked, I need to take the value of a few form fields on the page and append those to the hyperlink.


Ala: page1 has Form1, with Text1 on it. When LINK is clicked, I need to call page2?text1=data (where data is the text from text1).



Many thanks!
 

russ-iha

Ars Praefectus
4,407
Subscriptor
Yeah, I got it figured out.

Code:
<SCRIPT LANGUAGE="JavaScript">
<!--- Hide from worthless browsers
function LinkBuilder(theForm) {
	var lnk;
	lnk = "email_lk.asp?ticket=" + theForm.TICKET.value + "&from=" + theForm.FROM.options[theForm.FROM.selectedIndex].text + "&desc=" + theForm.DESC.value;
	window.location.replace(lnk);

}
// end hiding --->
</SCRIPT>
 
Status
Not open for further replies.