Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

is this syntax is okay?

Avatar

Level 8

Hello

My requirement is that, i have to find out that the given(in question) variable / text field object has any value / contaning any value / holding any value / does user has inputted any value?

I mean, if tehre is any blank white spaces, null......then, am not interested, it should hold REALLY a value.

So, when i searched in google, i found the below,

var myTestField

if (!/^\s*$/.test(myTestField))

// yes, some value (not blank, not null) is there, you can put ur logic here

{

1) Pls. let me know is it gonna work for my requirement (as our system is down, i can not test it!)?

2) is there any better approach? i guess, we have hasValue in FormCalc.

Thank you

0 Replies