Hi All.
I would like capitalize first letter in Last Name text field. Could someone let me know how to capitalize it in JavaScript?
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
eugzl wrote...
I found online code but it works in FormCalc in exit event. I need same in JavaScript. How to convert that code
txt = Concat(Upper(Left(txt,1)), Lower(Right(txt,Len(txt)-1)))
to JavaScript? The txt field name.
Thanks.
Hi
There are 3 option to convert Excel formula to JS:
1. By creating JavaScript code corresponding to it.
2. Use Third part JQuery plugins to run Excel formules.
Link:-http://www.igniteui.com/javascript-excel-library/excel-formulas
3. Excel to JS convertor :
Link:- http://excelformulabeautifier.com/ (Choose "Formula to JavaScript")
I hope this would help you.
~kautuk
Views
Replies
Total Likes
See this community thread - so use the same logic that is shown in this thread in AEM:
Hope this helps...
Views
Replies
Total Likes
Hi smacdonald2008. Thanks for replay.
I need code to capitalize first letter LastName field in form that I developed in Adobe Experience Designer. I'm thinking will better for Change or Exit event. If you know how to get result I will appreciate for help.
Thanks.
Views
Replies
Total Likes
Hi
I am not sure what exactly is you use case. I would request you to please explain it bit more.
But, if it is something related to converting First letter of Last Name in Dialog field to Capital, then we can certainly do it :
1. Dialog validation: in this validation check, you can specify any checks you would like to do.
Link:- http://www.nateyolles.com/blog/2016/02/aem-touch-ui-custom-validation
//
$.validator.register({
selector: '.field-phonenumber',
validate: function(el) {
var field,
value; // Nay Javascript/Jquery condetions that you would like to check.
field = el.closest(".coral-Form-field");
value = el.val();
if (!/^\d{3}-\d{3}-\d{4}$/.test(value)) {
return Granite.I18n.get('The field must be a phone number in the format of "xxx-xxx-xxxx"');
}
},
Another Reference article for Dialog Validation is :- https://helpx.adobe.com/experience-manager/using/creating-touchui-validate.html
For JavaScript to convert all first letter to capital:-
//var saa = sa.toLowerCase();
var sb = saa.replace( /(^|\s)([a-z])/g , function(m,p1,p2){ return p1+p2.toUpperCase(); } );
var sc = sb.replace(/\s+/g, '-');
return sc;
I hope this would help you.
~kautuk
Views
Replies
Total Likes
I found online code but it works in FormCalc in exit event. I need same in JavaScript. How to convert that code
txt = Concat(Upper(Left(txt,1)), Lower(Right(txt,Len(txt)-1)))
to JavaScript? The txt field name.
Thanks.
Views
Replies
Total Likes
eugzl wrote...
I found online code but it works in FormCalc in exit event. I need same in JavaScript. How to convert that code
txt = Concat(Upper(Left(txt,1)), Lower(Right(txt,Len(txt)-1)))
to JavaScript? The txt field name.
Thanks.
Hi
There are 3 option to convert Excel formula to JS:
1. By creating JavaScript code corresponding to it.
2. Use Third part JQuery plugins to run Excel formules.
Link:-http://www.igniteui.com/javascript-excel-library/excel-formulas
3. Excel to JS convertor :
Link:- http://excelformulabeautifier.com/ (Choose "Formula to JavaScript")
I hope this would help you.
~kautuk
Views
Replies
Total Likes
Views
Likes
Replies