Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Form 11 | Q975 [ previous next ]

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

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.