Skip to main content
Dec 28, 2021 7:10 AM UTC
Question

How to dynamically change font size of text box

Hi,

 

I'm trying to change the font size of the text box label using custom CSS. So whenever a user enters something into the text box, the custom CSS class will be changed using the expression function. 

 

Velkumar_0-1640675211373.png

 

This is for one text box widget. If I want to use more than 20 text boxes, I need to create 20 expressions to validate/change the custom CSS class. 

 

Is there some efficient way to achieve this requirement instead of creating multiple expression functions 

 

Regards,
VR

 

6 replies

Jan 3, 2022 3:14 PM UTC

You can assign a 'custom class' to the text boxes and then create CSS for that one 'custom class'.

Better yet, create custom classes for any widget types that need this behavior and put your CSS in a Master so it 'trickles' down into all your mashups.

VelkumarAuthor
Jan 4, 2022 5:38 AM UTC

Hi @PaiChung 

 

Sorry I didn't get it properly. Could you please give some example 

 

/VR

Jan 4, 2022 1:25 PM UTC

https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Mashup_Builder/Mashups/MashupCustomClassProperty.html#

 

You can also do searches from support.ptc.com to perhaps find additional examples and directions.

Jan 12, 2022 7:18 PM UTC

Hi @Velkumar.

 

You could possibly use the Grid Advanced widget which has state-based formatting.  Under 9.3, it's just called Grid.

 

Regards.

 

--Sharon