[Javascript] Script transferring values - so close

Peter Brunone peter at brunone.com
Thu Jun 13 10:29:29 CDT 2002


Glenn,

	In the script below, you are specifying a form called "form1" that does not
exist.  If you were to change "form1" to "mno", you would of course get the
data in the textarea called "Newform"... but apparently that's not quite
what you want.
	Have you considered a server-side solution?  Parsing the querystring (as
Rodney suggested) would definitely work, but if you have the option to use
CGI, ASP, PHP, etc. I would definitely recommend doing so.  Your server
admin will know what tools you can use; it's probably worth the call.

Regards,

Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Glenn Morris
|Sent: Thursday, June 13, 2002 8:48 AM
|To: javascript at LaTech.edu
|Subject: [Javascript] Script transferring values - so close
|
|
|I have this script which works almost the way I want it. What I want
|it to do is take the values(fname, lname) and pass them to a new form
|in the same browser window. The problem with this script is that it
|creates a default form showing the values. What I want it for it to
|place the values in a form (NewForm.html) that I have created and sits
|in the same directory. I'm sure I'm just a little tweak away from
|getting it to work but I can't seem to figure out how. Thanks for any
|help.
|1. Person presses Click
|2. My html form called NewForm.html shows up with fname, lname in
|editable field.
|3. All done in same browser.
|This is all I want it to do.
|
|<HTML>
|<head>
|<title> I juz don't get /Newform??</title>
|<script language="JavaScript">
|function unloadMess(){
|var fna=mno.fname.value;
|var lna=mno.lname.value;
|if(document.all && document.getElementById){
|
|form1.Newform.value=fna+' '+lna;
|}
|}
|</SCRIPT>
|
|</head>
|<body>
|<P><FORM name="mno" id="mno" METHOD=post ACTION="/NewForm.html" ><BR>
|<INPUT TYPE="hidden" NAME="fname" VALUE="Ned">
|<INPUT TYPE="hidden" NAME="lname" VALUE="Flanders">
|<INPUT TYPE="hidden" NAME="fax" VALUE="">
|<INPUT TYPE="submit" VALUE="Click here to email">
|<BR>
|<Center><INPUT TYPE=submit VALUE="Process">
|<input type="button" onclick="unloadMess();window.focus()" value
|="Click">
|</center>
|</FORM>
|<form name="form1"><textarea name="Newform"></textarea></form>
|</body>
|</HTML>
|
|
|_______________________________________________
|Javascript mailing list
|Javascript at LaTech.edu
|https://lists.LaTech.edu/mailman/listinfo/javascript
|




More information about the Javascript mailing list