Expand my Community achievements bar.

Calculation script issue after applying schema

Avatar

Level 2

I have a form with a basic javascript calculation script in it. When I apply an XML schema to the form the script no longer works and I can't figure out how to make it work after the schema has been applied. Obviously the XML has changed but when I change my script to use the new XML it doesn't work. Any idea what I need to do to get this to work?

Thanks for your help,

Brian

4 Replies

Avatar

Former Community Member

Can you post your form so we can see the issue?

Paul

Avatar

Level 2

ABC-1.pdf has a javascript calculation script in it. If I apply ABC.xsd to it the script and bind the different fields to the nodes in the schema the script no longer works and I can't figure out how to make it work.

My actual form and schema is much larger but I can recreate the problem with the above form and schema so I assume fixing it on this form will tell me how to fix it on my real form.

Thanks again,

Brian

--EDIT--

Apparently I can't attach an XSD file but mine looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="P1">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="A"/>
    <xs:element ref="B"/>
    <xs:element ref="C"/>
   </xs:sequence>
  </xs:complexType>
</xs:element>
<xs:element name="Form">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="P1"/>
   </xs:sequence>
  </xs:complexType>
</xs:element>
<xs:element name="C" type="xs:string"/>
<xs:element name="B" type="xs:string"/>
<xs:element name="A" type="xs:string"/>
</xs:schema>

Avatar

Former Community Member

I think I know what is happening ....you have referenced filelds with form1........the root node of the form. When you import the schema the root node of the form changes to the root node that you chose in the schema. Look at the hierarchy view and notice the root node after you import the schema. You will have to update your code to reflect the structure change.

Paul

Avatar

Level 2

Thanks that does fix that problem but it seems to create a new one in my real form which I am attaching. My real form has a dynamic table and my javascript handles the growing number of rows and the data in it just fine until I apply the schema. Once I fix my script and change it to use the root node of the schema the first row of the dynamic table works fine. But if I add a new row it already has the data from row 1 in it and if I change the data in row 2 it changes the data in row 1 also.

If you delete the data connection the dynamic table and related javascript works just fine.

Thanks again for your quick help with all of this,

Brian