|
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>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.