I want to have all entered text populated into specific text fields to automatically convert to upper case. I am working in LiveCycle Designer ES2.
Solved! Go to Solution.
I am not sure how to place the code to get it working. Cannot get it to work.
Views
Replies
Total Likes
Hi,
Place the following code in the change event of textfield to make the input in upper case
xfa.event.change=xfa.event.change.toUpperCase();
Hope it helps
Thank you for your assistance.
Where is the change event to place the code? I pasted the code into the function area but it did nothing.
Joe
Views
Replies
Total Likes
Please check the code in the uploaded the file
Views
Replies
Total Likes
Cannot open the document using the link. Says my Adobe cannot support the document. I have Adobe Reader X and Acrobat Pro X installed on my computer.
Views
Replies
Total Likes
I have attached the screenshot of the code
Thank you. All working now. Had a wrong setting before.
Views
Replies
Total Likes
Thanks again. Can this code work for Proper case if I just change the code text from UpperCase to ProperCase?
Views
Replies
Total Likes
Use the below code on exit event of textfield
if (!(this.isNull || this.rawValue == "")) {
var str = this.rawValue;
var char1 = str.substring(0,1);
var char2_n = str.substring(1,str.length);
this.rawValue = char1.toUpperCase() + char2_n.toLowerCase();
}
Thanks,
Vipin
Views
Replies
Total Likes
Thank you. Works only for the first word. All words after the first word remain in all lower case. The fields being populated contain names of organizations and all first letters of the major words need to be capitalized. Also will be used for fields populating names of people if it works so both first and last names will need to be proper case.
Views
Replies
Total Likes
You shouls use this script
function capitalizeEachWord(str)
{
var words = str.split(" ");
var arr = Array();
for (i in words)
{
temp = words[i].toLowerCase();
temp = temp.charAt(0).toUpperCase() + temp.substring(1);
arr.push(temp);
}
return arr.join(" ");
}
and call as
upper.rawValue= js.capitalizeEachWord(this.rawValue);
Also i have uploaded the PDF
https://workspaces.acrobat.com/?d=54*PMvnV4z9bIjJ5siGiEw
Thanks,
Vipin
Views
Replies
Total Likes
I cannot open the link to see the code as PDF. I wish I knew what Adobe version I need since I have Reader X and Acrobat Pro X installed.
Views
Replies
Total Likes
I am not sure how to place the code to get it working. Cannot get it to work.
Views
Replies
Total Likes
I have attached the screenshot of both the places (i.e., where i used the script)that will help you to use this script into your form.
1. On js variable
2. On exit event of textfield1
Thanks,
Vipin
Views
Replies
Total Likes
Thank you. I just cannot see how to enter the js variable as it appears in your screenshot. I see no option to enter variable and cannot change the text from subform to variable in the function area.
Views
Replies
Total Likes
It seems you are facing issue while creating Script object(js).To create a new script object, right-click on the order object at the top of your form hierarchy. Select Insert Script Object from the pop-up menu. A new script object appears below the Validation script object.
Thanks,
Vipin
Views
Replies
Total Likes
Thank you. Got the views matching yours but still does not work for the Proper Case. Your Change Case document with the two text fields even does not work to Proper case.
Views
Replies
Total Likes
It seems you are missing something, please share your email ID i'll send the working form.
Thanks,
Vipin
Views
Replies
Total Likes
info@jcytournaments.com
Please check your mail, i have shared the form.
Steps to use the form.
1. Open the PDF form
2. Type something in the textfield1.
3. Press tab key.
4. You will find the result in the textfield2.
Thanks,
Vipin
Thank you. I am trying to get the entered text to auto change to Proper case without being moved to a different text field. That does not help my form. I need the entered text to change within the same field. I cannot be adding extra text fields just to change the case.
Anyway, it is just a wish and maybe it is not possible to do.
Thank you for your assistance.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies