Skip to main content
Inspiring
May 10, 2021
Question

Adding a seq. number generator field to a text field that then becomes the subject line of an email

  • May 10, 2021
  • 1 reply
  • 840 views

Hi... I have created a sequential field using help sourced from this forum a few years ago... (called 'SEQ1') using the following code;

 

var num = this.getField("SEQ1");

num.value = Number(num.value)+1;

num.defaultValue = num.value;

 

I am using 'submit a form' to mail the PDF complete to 3 email addresses (I can get that to work).

 

I have 3 issues however (that are interlinked);

 

1) I would like for this sequential number to be prefixed by the letter 'L' and 4 zeros (i.e. L00001, L00002 etc)

2) I would like the content of this field to be added to the subject line of the submitted email (i.e. currently the subject of the line is 'Emailing {filename.pdf}' and I would like it to read 'Emailing L00001 {filename.pdf})

3) This is being used as an ordering sheet for use on an iPad... as such I have used a 'reset form' command (and excluded the 'SEQ1' field so that this isn't inadvertently set back) to clear the contents of the fields throughout the form, but as it is an iPad form, the user completes the following steps;

a) opens the form

b) reserts the form (to avoid ordering of items previously listed) - this works

c) selects quantities for items (by means of drop down quantities) - this works

d) submits the form by email by clicking a button-field - this works (but ideally would cater for 1&2 above)

e) IMPORTANT - exits the form by clicking the arrow at the top left of the screen on the ipad [as far as I can tell, this 'minimises' the form as opposed to 'saves' it... so the sequential numbering doesn't work].

 

Sorry there is a lot here, but as you can see they are all intertwined 

 

Many thanks if you can help - I'm not a coder 😕😕 my guess is that the 'submit form' needs to be a JavaScript code but at that point the birds start chirping!

 

Simon

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 10, 2021

This is not possible on an iPad. You can do it on a regular PC using a script, though.

SBrad249Author
Inspiring
May 10, 2021

Shame... 

 

But thanks 🙂