I am trying to call a javascript variable into an html form so I can email it.
This code gets a variable from the URL called “DistId”.
[code]
//Gets DistID from URL
var query = window.location.search;
// Skip the leading ?, which should always be there,
// but be careful anyway
if (query.substring(0, 1) == ‘?’) {
query = query.substring(1);
}
var DistID = query.split(‘,’);
for (i = 0; (i < data.length); i++) {
DistID[i] = unescape(data[i]);
}
What I need to do is figure out how to call “DistId”. I am attempting to go about by using the following. But of course, I am just getting the literal and not the variable.
[code]
<!—Trying to get variable DistID to be sent in email–>
<input type=”hidden” name=”Dist ID” value=’DistID’>
Any suggestions about calling it or know another way of getting the variable into the email?