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

Question

Question

Hiding a text field when it doesn't contain numbers.

asked on July 26, 2017 Show version history

Hello,

 

I have a field that generates a block trade number from salesforce when a button is clicked.

The text field is currently default value with "var_BlockTradeIDandNumber" which should be replaced by numbers when the form is started. What kind of condition would I be using to check if the field has numbers in it? I thought about {0-9}, or perhaps I have to write it out 0,1,2, etc. I did some initial digging but decided to put a post out there just in case someone is able to help me out before I find a solution.

 

Thanks

0 0

Replies

replied on July 26, 2017

Hi Duane,

Since you know the default value of the field, what about use field rule to hide the field when its value equals to default?

If the value could be updated to other value that does not contain number, then you need to use custom script to check value on change event. You can use function like this to check if string contains number:

function hasNumber(myString) {
  return /\d/.test(myString);
}

 

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

Sign in to reply to this post.