# HG changeset patch # User paulb # Date 1115406811 0 # Node ID 3a3fda181f586e238f4764003da2a0618d83c78e # Parent 12c73e0cd7a17cefe86148459f0da612ccf49b49 [project @ 2005-05-06 19:13:31 by paulb] Introduced code to handle partial document updates using additional request parameters and information for the part of the document to be updated. diff -r 12c73e0cd7a1 -r 3a3fda181f58 examples/Common/Configurator/Resources/scripts/XSLForms.js --- a/examples/Common/Configurator/Resources/scripts/XSLForms.js Fri May 06 19:13:16 2005 +0000 +++ b/examples/Common/Configurator/Resources/scripts/XSLForms.js Fri May 06 19:13:31 2005 +0000 @@ -1,9 +1,16 @@ -function requestUpdate(url, fieldName, targetName) { +function requestUpdate(url, fieldName, targetName, targetFieldName) { var xmlhttp = Sarissa.getXmlHttpRequest(); xmlhttp.open("POST", url, false); var fieldValue = document.getElementsByName(fieldName)[0].value; + var targetFieldValue; + var targetFieldNodes = document.getElementsByName(targetFieldName); + if (targetFieldNodes.length != 0) { + targetFieldValue = targetFieldNodes[0].value; + } else { + targetFieldValue = ""; + } //alert(fieldValue); - xmlhttp.send(fieldName + "=" + fieldValue); + xmlhttp.send(fieldName + "=" + fieldValue + "\r\ntarget-field-name=" + targetFieldName + "\r\n" + targetFieldName + "=" + targetFieldValue); //alert(xmlhttp.status); //alert(xmlhttp.responseText); var newDocument = Sarissa.getDomDocument();