Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q975 How can I combine the value of two form fields, and then only pass the combined value to the server?

You are here: irt.org | FAQ | JavaScript | Form | 11 | Q975 [ previous next ]

The only way to not send data in a form field is to not name the form field.

<script language="JavaScript"><!--
function textBuild() {
     document.formName.data.value =  document.formName.elements[1].value + ' ' + document.formName.elements[2].value;
}
//--></script>

<form name="formName" action="cgi-bin/query" onSubmit="textBuild()">
<input type="hidden" name="data">
<input type="text">
<input type="text">
<input type="submit">
</form>

©2018 Martin Webb