I have an html file that parses passed parameters with
this code:
____________________________________

<script type="text/javascript">

var query = location.href.substring((location.href.indexOf('?')+1), location.href.length);
if(location.href.indexOf('?') < 0) query = '';
querysplit = query.split('&');
query = new Array();

for(var i = 0; i < querysplit.length; i++){
   var namevalue = querysplit[i].split('=');
   namevalue[1] = namevalue[1].replace(/\+/g, ' ');
   query[namevalue[0]] = unescape(namevalue[1]);
}

window.onload = function(){
   // Do stuff with query string data here.

   document.getElementById('state').innerHTML = query['state'];
}

var value = <span id='state'></span>;

</script>

<HTML>
<HEAD>
<TITLE>Title</TITLE>
</HEAD>
<BODY>

<p>The valve is <span id='state'></span> </p>

</body>
</html>
____________________________________



All that works fine.

Then I try to copy the parsed value in the Subject field
as follows:


____________________________________

<FORM ACTION="http://lotsofstuffhere&confirm=confirmed.html&error=error.html"; METHOD="POST">
<INPUT NAME="recipient" TYPE="HIDDEN" VALUE="myemail">
<TABLE>
<TR>
 <TD valign=middle>Your Name:</TD>
 <TD><INPUT NAME="name" SIZE="30"></TD>
</TR>
<TR>
 <TD valign=middle>Your E-mail:</TD>
 <TD><INPUT NAME="e-mail" SIZE="30"></TD>
</TR>
<TR>
 <TD valign=middle>Link:</TD>
 <TD><INPUT NAME="link" SIZE="60" VALUE="Some Link"></TD>
</TR>
<TR>
 <TD valign=middle>Subject:</TD>
 <TD><INPUT NAME="subject" SIZE="60" VALUE=<span id='state'></span>></TD>
</TR>
<TR>
 <TD valign=top><BR>Comments:</TD>
 <TD><TEXTAREA NAME="body" VALUE="" cols=60 rows=10></TEXTAREA></TD>
</TR>
<INPUT NAME="followup-page" TYPE="HIDDEN" VALUE="http://www.myprogram";>
<TR>
 <TD></TD>
 <TD><INPUT TYPE="submit" name="submit" VALUE="Send"></TD>
</TR>
</TABLE>
</FORM>
____________________________________



This does not work.  It puts "<span" in the subject field.

Is it because of scoping?  How can I get this to work?  I tried
literally 40 different things, but none worked.  I also spent
roughly 4 hours searching for a solution.

I can get this done with a Perl file, but unfortunately my
Webserver will not run it properly.


Mike


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to