Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

is this syntax is okay?

Level 8
Level 8


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