Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How to convert all text fields to uppercase globally on a form?

Avatar

Former Community Member

I have created a form with LiveCycle Designer ES2 9 and there are a lot of text fields.  I would like to know if there is a way to make a global setting for the form that converts all text field data to uppercase?  I have found that by adding xfa.event.change = xfa.event.change.toUpperCase(); to the "change" event will allow me to convert one field at a time but as I mentioned before, I have a lot of text fields and I would not want to add this repeatedly to every one of them.  So, is there a way to make this change at the form level for all text fields.

Thank you,

8 Replies

Avatar

Former Community Member

You can iterate over all the nodes in a container, find all the objects of class name 'field' and translate the rawValue to upper case. The attached works fine for text fields and buttons but I am not sure about other field types including drop-down. Please test.

// form1.page1.toUpperCaseBtn::click - (JavaScript, client)


var oNodes = page1.nodes;

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

  if (oNodes.item(i).className == "field") {

    if (oNodes.item(i).rawValue != null) {

      var oField = oNodes.item(i).rawValue;

      oNodes.item(i).rawValue = oField.toUpperCase();

    }

  }

}

Steve

Avatar

Former Community Member

Thank you for your response.  I see how the code that you supplied would work as exepcted on a single page form.  I am sorry that I did not give further details about the form I have created.  The form has multiple sub-forms within it and depending upon what is selected on the "Welcome Page" a particular sub-form is displayed.  Also, all of the data is populated into a 2D barcode also in the sub-form.  I currently have a "Print Button" on each sub-form which prints the completed form with the populated data in the 2D barcode.  I attempted to add your supplied code to the "Print Button" on one of the sub-forms and when I clicked it the application became unresponsive.

I have also tried adding the code that I mentioned before to the "Change" events of each of the text fields and that seems to work well.  Although, I am unsure if my approach adds too much overhead and will cause performance issues with the form.  Do you know of a way I could incorporate your code with the "Print Button" on each sub-form and avoid the unresponsiveness?

Thank you

Avatar

Former Community Member

Are you converting the data to upper-case for the purpose of the barcode encoding?

Steve

Avatar

Former Community Member

Yes, the data populated in the barcode data is being read after the paper document has been scanned.  The resulting data is then popluated into a database and it was left to me to do the conversion to uppercase at the beginning on the form.

Avatar

Former Community Member

Do the conversion to upper-case in the barcode encoding instead.

Steve

Avatar

Former Community Member

Would this also cause the fields on the printed form to be in uppercase or only the data in the barcode?  I ask this because if there is an issue with the barcode read then the document must be keyed from image and I am also concerned about legibility of the printed form.

Avatar

Former Community Member

The conversion to upper-case on the barcode encoding will impact the barcode contents only.

I am curious why you are using a barcode and continuing to do manual data entry from the form image? The objective of the PaperFormsBarcode is to eliminate data entry.

Steve

Avatar

Former Community Member

The form is sent to our customers who will fill in the information for their clients, print off the form and then send it to us.  This form is eliminating the hand written forms currently utilized in our processing.  It is also designed to help eliminate the manual keying process on our side and putting the owness onto our customers to fill in the necessary data.  I have not been able to get us into place where we can simply use a dedicated web page that would automatically populate our databases.  I know that it sounds odd, but there are still some of our customers who have just started using computers in their businesses.  For these customers and others, we are implementing this form to allow them to fill it out and fax it back or scan and send.