Expand my Community achievements bar.

Using process and Interactive events together

Avatar

Former Community Member
Hello,



having a tough time getting my form to work fully from the client side. I

am using LiveCycle Designer 8.0 on an existing pdf.









The way the form is supposed to work is when the user enters a dollar amount (i.e. wages) into separate form fields, The amounts are totaled and placed in to a numeric field. I used the FormCalc Event (calculate) to achieve the results.









After the results are placed in the numeric field, I then created a button to transfer the results from the numeic field and attempted to place each number in an individual text field. The code that I used was (javascript):









var toConvert = nfield3[0];



var chars = new String(toConvert.rawValue);



var combFields = xfa.resolveNodes("comb[*]");









for (var i = 0; i < combFields.length; i++) {



combFields.item(i).rawValue = "";



}





if (toConvert.rawValue != null {



for (var i = 0; i < chars.length; i++) {



combFields.item(i).rawValue = chars.charAt;



}



}







The problem that I'm having is that although, The results will calculate correctly in the numeric fields, I cannot get the results to post in the individual fields when the button is clicked.









I read somewhere in the documentation that process and interactive events only work on the server side. Is that correct. Thanks in advance.
1 Reply

Avatar

Former Community Member
Hi,



The script is not quite right. Try the following:



var toConvert = xfa.resolveNode("nfield3[0]");

var chars = new String(toConvert.rawValue);

var combFields = xfa.resolveNodes("comb[*]");



for (var i = 0; i < combFields.length; i++)

{

combFields.item(i).rawValue = "";

}



if (toConvert.rawValue != null)

{

for (var i = 0; i < chars.length; i++)

{

combFields.item(i).rawValue = chars.charAt(i);

}

}



I suggest using the JavaScript Debugger when you are not seeing the expected results. When you preview the form, press the CTRL+J keys.



Have you thought of using a comb field instead? Comb fields are available in Designer 8.0. The script could be as simple as



combField.rawValue == ;

combField.rawValue = numField.rawValue;



Regards,



Hélène

Adobe Systems