1.1 --- a/examples/Common/Configurator/Resources/scripts/XSLForms.js Sun May 08 22:08:32 2005 +0000
1.2 +++ b/examples/Common/Configurator/Resources/scripts/XSLForms.js Sun May 08 22:08:58 2005 +0000
1.3 @@ -1,4 +1,4 @@
1.4 -function requestUpdate(url, fieldName, targetName, targetFieldName) {
1.5 +function requestUpdate(url, fieldName, targetName, targetFieldNames) {
1.6 var xmlhttp = Sarissa.getXmlHttpRequest();
1.7 xmlhttp.open("POST", url, false);
1.8
1.9 @@ -6,19 +6,36 @@
1.10
1.11 var fieldValue = document.getElementsByName(fieldName)[0].value;
1.12
1.13 - // Find the value of the target field, along with the node where the target field is defined.
1.14 + // Process each target field name.
1.15 +
1.16 + var targetFieldNameArray = targetFieldNames.split(",");
1.17 +
1.18 + // Send the controlling field value.
1.19 +
1.20 + var requestBody = (fieldName + "=" + fieldValue);
1.21 +
1.22 + // Add the values of the dependent fields.
1.23 +
1.24 + for (var i = 0; i < targetFieldNameArray.length; i++) {
1.25 + var targetFieldName = targetFieldNameArray[i];
1.26
1.27 - var targetFieldValue;
1.28 - var targetFieldNodes = document.getElementsByName(targetFieldName);
1.29 - if (targetFieldNodes.length != 0) {
1.30 - targetFieldValue = targetFieldNodes[0].value;
1.31 - } else {
1.32 - targetFieldValue = "";
1.33 + // Find the values of the target field.
1.34 +
1.35 + var targetFieldValue;
1.36 + var targetFieldNodes = document.getElementsByName(targetFieldName);
1.37 + for (var v = 0; v < targetFieldNodes.length; v++) {
1.38 + targetFieldValue = targetFieldNodes[v].value;
1.39 + requestBody += ("\r\n" + targetFieldName + "=" + targetFieldValue);
1.40 + }
1.41 +
1.42 + // Add the target name specification.
1.43 +
1.44 + requestBody += ("\r\ntarget-field-name=" + targetFieldName);
1.45 }
1.46
1.47 // Load the remote document with the given parameters sent as text in the request body.
1.48
1.49 - xmlhttp.send(fieldName + "=" + fieldValue + "\r\ntarget-field-name=" + targetFieldName + "\r\n" + targetFieldName + "=" + targetFieldValue);
1.50 + xmlhttp.send(requestBody);
1.51
1.52 // Parse the result document.
1.53