<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>Hi
Rick </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>You
problem sound pretty simple I guess that you on only trying to change the
value in your input once you clicked the submit button and let the document
submitting.</FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>What's
happen is when you click on the submit the page will automaticly gather the info
of your form and start to send it to the recipient page and your javascript to
populate the input occur after this that why your CGI get null for the input
field </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>What
you should do is </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>1: on
the form tag have something like this <form name="whatever" onsubmit="return
doSomething()"></FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>function doSomething(){</FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>// your code to change the input value go here and
after <SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>return true </FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>return
true </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>//if
you want the form to stop being submitted return false </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>or
second solution </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>2:
replace the input type submit by a input type button </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2><input type="button" name="myButtonSimulateSubmit" value="Submit"
onclick="doSomething()"></FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>function doSomething(){</FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>// your code to change the input value go here and
after submit the form </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>document.formName.submit()</FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>//if
you want the form to stop being submitted don't call the <SPAN
class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>document.formName.submit()</FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff size=2>PS:
One really important things with point 2 is that you must make sure that no
element button input type or nothing else is name submit or this will cause an
error </FONT></SPAN></DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=218434909-01082003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Rick Warren
[mailto:webmaster@bizmaxsoftware.com]<BR><B>Sent:</B> 01 August 2003
04:45<BR><B>To:</B> javascript@LaTech.edu<BR><B>Subject:</B> [Javascript]
Changing INPUT values in forms after submit is pushed<BR><BR></FONT></DIV>
<DIV>
<DIV><FONT face=Arial size=2><SPAN class=133413503-01082003>I have a form that
uses an onsubmit to validate the data and calculate options selected in the
form. I need to pass the calculated value back to an INPUT tag's value
to be sent to a CGI script. I use something similar to f.tag.value =
calc_value where calc_value is the calculated value my validation/ calculation
script generates. When the data makes it over to my cgi program,
the tag value is null. What's
wrong??? </SPAN></FONT></DIV></DIV></BLOCKQUOTE></BODY></HTML>
<BR>
<BR>
<P><B><FONT SIZE=2 FACE="Arial">DISCLAIMER - The preceding e-mail message (including any attachments) contains information that may be confidential, may be protected by the attorney-client or other applicable privileges, or may constitute non-public information. It is intended to be conveyed only to the designated recipient(s) named above. If you are not an intended recipient of this message, or have otherwise received it in error, please notify the sender by replying to this message and then delete all copies of it from your computer system. Any use, dissemination, distribution, or reproduction of this message by unintended recipients is not authorized and may be unlawful. The contents of this communication do not necessarily represent the views of this company.</FONT></B></P>