Skip to main content
New Participant
July 30, 2021
Question

Text field in dynamic stamp

  • July 30, 2021
  • 2 replies
  • 3632 views

 

Hello people

 

I have read through countless postes and am unable to figure out how to get this stamp to work 

 

text 1 workes perfectly as a automatic date 

 

i need text 2 to be just a regular text feild so when i wherever on the screen i can then add a 6 digit number ex 416051 not more not less 

 

Much aprechiated 

This topic has been closed for replies.

2 replies

bebarth
Braniac
July 31, 2021

To be placed in calculation script of the Text2 field:

var answer="";
while (!/^\d{6}$/.test(answer) && answer!=null) {
	var answer=app.response({
		cQuestion: "Enter a 6-digit number.",
		cTitle: "Reference",
		cLabel: "MAXIMO #",
		});
}
if (answer!=null) event.value=answer;
else event.value="";

 

New Participant
June 30, 2023

What if you don't want to limit it to six characters, and want to allow letters as well as numbers?

try67
Braniac
June 30, 2023

Then don't use the conditional code at all. Just this:

if(event.source.forReal && event.source.stampName=="#Received") {
	event.value=app.response("Enter the value for this field:");
}
try67
Braniac
July 30, 2021

Stamps don't work like that. Once you apply them all the fields in them become flattened. You have to prompt the user to enter the value for this field when the stamp is applied, and then populate it into the field. After the stamp is applied it can't be edited any longer. You can only delete the stamp and re-apply it using a new value.

New Participant
August 31, 2023

Hello try

You seem like a expert so i would love to ask for your help with a dynamic stamp problem of mine. 
I have a dynamic stamp with many fields which are filled by: value = app.response(""). in some cases i don't need the script to ask for all the fields so it would be nice that whit some kind of input in the app.response-pop-up i could end the script prematurely. I hope you understand my problem. English and Coding are not my native languages..haha
Thanks in advance

Timo

try67
Braniac
August 31, 2023

If you want to include logic in determining which values to prompt the user to enter using a dialog object might be a better idea. This is not a trivial scripting task, though.