Hi,
I have a picklist in contact form which its values are populated through
another web application during onLoad event on contact form. The picklist
field is working fine when user load the form, however, whenever user click
the close button without entering any data on the form, he always get the OK
Cancel prompt asking him whether to navigate away from the form. I thought
this prompt only appear if user enter data and leave the form without saving?
Here's portion of my code:
//Create a new XML parser and load the received content into it. \par
var doc = new ActiveXObject("Microsoft.XMLDOM");\par
\par
//crmForm.all.new_codexml.DataValue = responseXml2;\par
doc.loadXML(responseXml2);\par
doc.setProperty("SelectionNamespaces","xmlns:diffgr='urn:schemas-microsoft-com:xml-diffgram-v1'");\par
\tab\par
//Access the nodes using a standard XPath query.\par
var codeList =
doc.selectNodes("/DataSet/diffgr:diffgram/CodeDescription/BranchCode/BranchDescription");//+ codeType + "/" +descType);\par
if(codeList.length == 0)\par
\{\par
\tab\tab return;\par
\}\par
codeList.reset();\par
\par
//traverse through the list to populate the field\par
var node = codeList.nextNode;\par
var i =1;\par
while (node != null)\par
\{\par
picklistField.AddOption(node.text, i);\par
i=i+1;\par
node = codeList.nextNode;\par
\}\par
\par
\par
\par
\tab if (codeField.DataValue != null)\par
\tab\{\par
\tab\tab //retrieve the desc of previously selected code\par
\tab\tab var sel = "/DataSet/diffgr:diffgram/CodeDescription/"+ codeType
+ "[" + codeType+ " = '" + codeField.DataValue + "']/" + descType;\par
\tab\tab node = doc.selectSingleNode(sel);\par
\tab\tab var description = node.text;\par
\tab\tab if(node != null)\par
\tab\tab\{\par
\tab\tab\tab //traverse through the picklist values to find the correct
option\par
\tab\tab\tab var option;\par
\tab\tab\tab for(var j = 0; j < picklistField.Options.length; j++)\par
\tab\tab\tab\{\par
\tab\tab\tab\tab var option = picklistField.Options[j];\par
\tab\tab\tab\tab if(option.Text == description)\par
\tab\tab\tab\tab\{\par
\tab\tab\tab\tab\tab picklistField.DataValue = option.DataValue;\par
\tab\tab\tab\tab\tab return;\par
\tab\tab\tab\tab\}\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\}\par
\par
\par
\f1\par
}