Copy link to clipboard
Copied
Hello,
I have a text field and I set it to "Comb of 10 characters". The field will consist of 0s and 1s.
01010111..
I'm trying to add 0s and 1s to the field during some operations but it's not working as expected. I would like it to be considered as a string.
this.getField("Text1").value = this.getField("Text1").value +"0";
Any idea? Thank you.
Use this :
this.getField("Text1").value = this.getField("Text1").valueAsString +"0";
Copy link to clipboard
Copied
You can't add additional characters beyond the limit of the Comb setting, if that's what you mean.
Copy link to clipboard
Copied
No, it's not what I mean. Yes, I know the max number is 10.
The problem is that after something like this
this.resetForm(["Text1"]);
this.getField("Text1").value = this.getField("Text1").value +"0";
this.getField("Text1").value = this.getField("Text1").value +"1";
this.getField("Text1").value = this.getField("Text1").value +"0";
The result is 10 not 010.
Copy link to clipboard
Copied
Use this :
this.getField("Text1").value = this.getField("Text1").valueAsString +"0";
Copy link to clipboard
Copied
The test field format is set to "None"