In article <dy************ *******@newssvr 29.news.prodigy .com>,
Don Stefani <no********@yah oo.com> wrote:
Hello,
I have a form that I want to submit "onchange", OK I've got that working, but
when the
form submits, I want to pass along a value to a CGI script, as if that value
was in a
hidden form element.
BUT, I don't want that value to be in the actual HTML form, I want it to be
created in my
submit function.
Please explain why a hidden field will not work for you.
If a field is not null, the field data will be sent to the host. Null
fields are not sent to the host. How can a hidden field cause you
problems?
You could create the hidden field dynamically, but a static hidden field
seems easier.
Here is a post about creating dynamic form fields
Re: How to expand the number of fields in a form? :
http://groups.google.com/groups?q=ma...group:comp.lan
g.javascript&hl =en&lr=&ie=UTF-8&oe=ISO-8859-1&selm=MPG.1af1 b944853eff5498
9da2%40nntp.luc ent.com&rnum=1
Here is an example using a static hidden field:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>A sample form</title>
<SCRIPT type="text/javascript">
function changeForm()
{
document.forms[0].the_current.va lue = "filled with data";
alert("form input value = " +
document.forms[0].hours.value +
" hidden value = " +
document.forms[0].the_current.va lue);
}
</script>
</head>
<body>
<form action=
"http://www.mindspring. com/cgi-bin/cgiemail"
method="post" name="payroll"
onSubmit="chang eForm()">
<input type="hidden" name="the_curre nt" value="">
<b>How many hours did you work this week?   </b>
<input type="text" name="hours" size="6" maxlength="3">< br>
<input type="submit" name="submit" value="Process form"> &nbs p
<br>
<input type="reset" name="reset" value="Reset Form">
</form>
</body>
</html>
Please note that I have not verified that the the field data was sent to
the host.
Robert