You are viewing limited content. For full access, please sign in.

Question

Question

Best option for converting all text in form fields to upper case

asked on March 25, 2015 Show version history

We are looking for a way to ensure data entered in our forms is consistent across the board wherever possible. 

Referring to the following post, I was able to restrict fields so only upper-case text can be entered, however I was wondering if there was a way to convert anything typed in to upper case when populating meta data in the repository?

It seems like there might be three possibilities:

1) Converting all text typed into any form fields to upper case (possibly using JavaScript to convert text to upper case on the fly) 

2) Converting typed text into upper case by converting when populating fields (whether on the Forms end, which doesn't look possible, or on the repository side, although there only appears to be constraints on what can be entered).

3) Workflowing all meta data to upper case, as a scheduled task, after information reaches the repository.

I wondered if anyone else had found a solution for this, and if so, what they did to ensure all information entered was in a consistent format?  Thanks to anyone who can assist!

Marty Gaffney - Network Technician

Town of Okotoks

0 0

Answer

SELECTED ANSWER
replied on March 26, 2015 Show version history

In my opinion, standardizing data should be done as close to point of entry as possible.

 

I would end up picking option #1 as currently I don't see a way to use the Token Dialog to force it to uppercase before Forms sends it to the repository. (You could fire a workflow off to do that but I'd personally rather add in a segment of Javascript than fire up an equivalent workflow).

 

Add the class "upperCase" to each field you want converted then the following javascript.

 

$(document).ready(function(){
  
  $('.upperCase input').focusout(function() {
    $( this ).val($( this ).val().toUpperCase());
  });

});

 

This will force upperCase after the user clicks somewhere else on the form.

 

Cheers,

Carl

 

 

3 0
replied on September 30, 2020

I know this is an old post, but wanted to include how to force uppercase for fields in a table.

Add the CSS class "upperTable" to each table that has field(s) you want to force to upper case.

Add the CSS class "upperCase" to each field in the table that you want to force to upper case.

Modify (add to) Carl's code

$(document).ready(function(){
  
  $('.upperCase input').focusout(function() {
    $( this ).val($( this ).val().toUpperCase());
  });
  // This will force table fields to upper case
  $('.upperTable').on('change', '.upperCase', function(e) {
    e.target.value = e.target.value.toUpperCase();
  });

});

 

2 0

Replies

replied on March 26, 2015

That's perfect, and looks to work with all of our text fields!  I noticed we can switch everything over to LowerCase for any text fields that need to be converted that way as well (e.g. Email addresses).

Thanks much!

Marty

0 0
replied on October 14, 2020 Show version history

The UPPER function worked for me.

 

0 0
replied on October 6, 2022 Show version history

Hi

Has anyone convert all text in form fields by JavaScript in a cloud form?

Note: using the new designer

0 0
replied on October 11, 2022

Got the solution for field by field with the help of Laserfiche.

Here's the JavaScript:

LFForm.onFieldBlur(function () { LFForm.setFieldValues({fieldId: 1}, LFForm.getFieldValues({fieldId: 1}).toUpperCase());}, {fieldId: 1});

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.