You are here: Reference Guides > Javascript Support > SVFormOnFormPreRender

SVFormOnFormPreRender

The SVFormOnFormPreRender function is a function that gets called before a form is rendered within the browser. This function is used to count how many times a form gets rendered while the form is opened in the browser.

Download example (.wssln file)

SVFormOnFormPreRender arguments

Argument

Description

renderCount

The internal count of the number of times a form is rendered. The count is set to 0 after the getting the form markup from the server. Every other time the form is rendered, the renderCount variable is incremented.

xmlDocument

The XML Document that contains all the XML of the form.

SVFormOnFormPreRender code sample

The following Code Snippet populates a field within a form with the amount of times the form is rendered:

//SVFormOnFormPreRender Example

//Create function with the renderCount and xmlDocument arguments

function SVFormOnFormPreRender(renderCount, xmlDocument) {

//Create a variable to place the value of renderCount in

var theRenderCount = xmlDocument.selectSingleNode("/my:myFields/my:field1");

//Set the value of field1 to the value of renderCount

theRenderCount.setValue(renderCount);

}