The second part of the if condition is not required. If the value is
already blank, why reset it?
Try this instead:
if (event.value == "135.31") event.value = "";
The bitwise operators only process 32 bits of the the data string and not the entire floating point number.
I would also use the valueAsString property to test for the null string character, the value property sometimes treats the null character as a zero not a null string..
if(event.value == 135.31 || event.valueAsString == '') event.value = '';
thanks, but this still did not work. Would it have anything to due with the fact that the value has a decimal?
Thank you. I don't know what Bitwise OR and Logical OR are. I copied this formula from another forum for $0.00 vaules so that they would not show. It worked for the $0.00 values, and it works for $125.00, but when I list a number with anything other than 00 after the decimal it doesn't work.
I copied and pasted your formula and it's still showing the $135.31 value in the feild.
Below is a snapshot of the form.
You can use the JS console to find out what's the exact value of the field.
Just execute this code:
That was my issue....I wasn't seeing the complete number since I had the field format set to show only 2 decimal places. I changed the format to show more places, changed the formula, and it works!
This the formula I've used: if (event.value == "135.3125") event.value = "";
Thank you both for your efforts!
One more question. Can a code be written so that if another field equals a certain number, that the current field is blank?
Example: if (Field1 == "0") event.value = "";
if (this.getField("Field1").value == "0") event.value = "";