[Javascript] problem passing values to my form

Glenn Morris gmorris at sct.com
Tue Jun 11 14:07:44 CDT 2002


I am having a problem passing values but I am so close (thanks to
freedogrun). This code below will transfer the fields (fname, lname)
into an editable field on a new form that will stay open in the
browser. This is exactly what I want it to do except that I want it to
put the values into a form that I created (/NewForm). I have the form
listed in the Action=/NewForm but it keeps opening a default form. If
I can get it to put the values in the new form I will be set. Thank
you in advance.
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       





<HTML>
<head>
<title> Like this, then?</title>
<script language="JavaScript">
function unloadMess(){
var fna=mno.fname.value;
var lna=mno.lname.value;
if(document.all && document.getElementById){
retVal = makeMsgBox("hello","This action will move all\n data to one
big editable textfield",32,1,256,0);
if(retVal == 1) {document.write('<h1>Ned\'s<small>© One big
form</small></h1><textarea name=\"writ\"style=\"width:100%;height:80%
\">enter vars here</textarea>');
writ.value=fna+' '+lna;
}
else if (retVal == 2) {alert("Ok, try again?");}
} else {
alert("I am not IE");
}
}
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
Function makeMsgBox(tit,mess,icon,buts,defs,mode)
butVal = icon + buts + defs + mode
makeMsgBox = MsgBox(mess,butVal,tit)
End Function
-->
</SCRIPT>
</head>
<body>
<P><FORM name="mno" id="mno" METHOD=post ACTION="/NewForm" ><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>
</body>
</HTML>





More information about the Javascript mailing list