Need code to find whether field contains text or integer

malaisamyj
Tera Contributor

Hi All,

I have a requirement where i have a string field in which i have written a business rule to calculate.

But i want specify condition saying that if the string field contains text it should not run the business rule.

Is it possible to get the value of field and differentiate whether its text or integer?

Thanks

Malaisamy

1 ACCEPTED SOLUTION

Shishir Srivast
Mega Sage

Please use isNaN() function to check if field contains number or not



JavaScript isNaN() Function


View solution in original post

6 REPLIES 6

Kalaiarasan Pus
Giga Sage

You are dealing with the problem in the reverse way.


Instead of addressing the issue at form to mandate integer, you are doing a hack at server side. Does this appear like a good approach?


Shishir Srivast
Mega Sage

Please use isNaN() function to check if field contains number or not



JavaScript isNaN() Function


HI Shishir,



I hope you are doing good.



I have a doubt how to specify with the field



Lets say i have field called sp_deno


If the above mentioned field contains number the business rule ot client script has to run.



How to specify that with client script and business rule?



Thanks


Malaisamy


Hello Malaisamy,



What is the use case, what Business Rule is trying do here?