You are here: Reference Guides > Javascript Support > SVFormXMLChanged

SVFormXMLChanged

The SVFormXmlChanged function is called once a field has been changed within the form.

Download example (.wssln file)

Note: The SVFormXmlChanged function will not execute until after a value has been entered into a field and the field has left focus.

SVFormXMLChanged arguments

Argument

Description

xmlDocument

The SVXmlDocument containing the entire XML of the form.

SVFormXMLChanged code sample

The following Code Snippet populates field2 with the text "The field has changed" upon execution of the function. If the argument xmlDocument is null, is displays an alert message saying ‘The xmlDocument was null!’:


//SVFormXmlChanged Example

//Create function with the xmlDocument argument

function SVFormXmlChanged(xmlDocument) {

//Only execute code if the xmlDocument is not null

if (xmlDocument != null) {

//Create variable to place some text into (optional)

var theField = xmlDocument.selectSingleNode("/my:myFields/my:field2");

//Set the variable theField to 'The Field Has Changed!'

theField.setValue("The Field Has Changed!");

}

//If the xmlDocument is null, display alert message

else {

alert("The xmlDocument argument is null!");

}

}