since ‎23-08-2020
Online
lostfrogg
Level 2
Betreff: Hi Kosta, I have the following script in the "presubmit"...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Hi Kosta,Yes that seemed to fix the issue! Thank you. One thing - with your script, I get this in the email subject header:Some Text: sdf sdf (ss)But what I am trying to get is:Some Text: SSI've been trying to delete the sdf bits but have been struggling to get it to work. Also not sure how to make the initials appear in capitals?

Views

27

Likes

0

Replies

0
Betreff: Hi Kosta, I have the following script in the "presubmit"...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Hi Kosta,When I change the colon, so that the script under the preSubmit (JavaScript) window looks like this:var sMailUrl=this.resolveNode("#event").submit.target;this.resolveNode("#event").submit.target=sMailUrl + "?subject=Referral to Liaison Psychiatry\: "+form1.Page1subform.PatientSubform.Forname.rawValue+" "+form1.Page1subform.PatientSubform.Surename.rawValue;I get a standard email subject line like this:

Views

45

Likes

0

Replies

0
Hi Kosta, I have the following script in the "presubmit"...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Hi Kosta, I have the following script in the "presubmit" area, running as Javascript;var sMailUrl=this.resolveNode("#event").submit.target;this.resolveNode("#event").submit.target=sMailUrl + "?subject=Referral to Liaison Psychiatry: "+form1.Page1subform.PatientSubform.Forname.rawValue+" "+form1.Page1subform.PatientSubform.Surename.rawValue;When I submit the form however, the email title is still generic and does not incorporate the text or fields above. Any further help much appreciated.

Views

86

Likes

0

Replies

4
Betreff: Hi Kosta, Thanks again for your input. I'm still struggli...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Thanks for that Kosta. I'm sorry, I've been an idiot. I've been working on the current date field, but testing on the current time field, for which I have not entered any code! Would you be able to advise on what I should put in the "current time" field to get it to lock that also?

Views

32

Likes

0

Replies

1
Hi Kosta, Thanks again for your input. I'm still struggli...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Hi Kosta,Thanks again for your input. I'm still struggling to get the date field to lock.Regarding the code you told me to put into the layout:ready field - do I just copy your code and paste it in? I don't need to change anything such as DateFmt? Should that code all be in FormCalc rather than JavaScript?When I change the DateFmt and have the following code in layout:ready with language set to FormCalc:if ($ == null) then$.rawValue = Num2Date(Date(), "YYYY-MM-DD")endifthen the form fills in OK ...

Views

68

Likes

0

Replies

3
Betreff: Looking to lock form on email submission and set something from the form in the email subject
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Thanks - I have this in the layout:ready event of the date field (in FormCalc): if ($ == null) then$.rawValue = Num2Date(Date(), "YYYY-MM-DD")endif When I try and submit the form however, I get an error message: "The value you entered for Current date: is invalid. To ignore validations for Current date; click Ignore." If I click ignore, it will submit the form, but the auto-calculated date field doesn't lock and just updates again whenever the form is opened.

Views

127

Likes

0

Replies

1
Betreff: Looking to lock form on email submission and set something from the form in the email subject
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Many thanks for your answer. Is it possible to have it show the name initials in the subject line? So instead of "Kosta Prokopiu", it would show "KP"? Also, I presume that I have to put in the "long" paths to the forename and surname fields in the script? Thanks

Views

129

Likes

0

Replies

6
Looking to lock form on email submission and set something from the form in the email subject
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
I have added an email submission button. I've looked around but can't seem to find the answer to this - how do I lock the form on submission? The form has an auto-populate today's date box, and currently every time I open the form it resets it to the current date. Second, I have fields on the form for "forename" and "surname". Would it be possible to have the following in the "email subject": [specific text] - (forename initial) (surname initial) Thanks!

Views

163

Likes

0

Replies

15
Re: Submit form button, which only submits the form if all (visible) required fields are completed, and then locks the form
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Still trying to work this one out so would be grateful for any help!

Views

70

Likes

0

Replies

0
Submit form button, which only submits the form if all (visible) required fields are completed, and then locks the form
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
I'm trying to add a submit form button, which only submits if all the visible required fields are completed. I also have some invisible required fields - they are invisible because not all subforms are shown each time - but if a subform is shown, then all fields on it need to be completed. Is this possible? I also want the button to lock the form, so that no further changes can be made (including to the auto-populated current date field).And thirdly, is it possible that when the form is being su...

Views

102

Likes

0

Replies

1
Betreff: Show a hidden object on the master page
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
I have a title bar at the top of each page, which I have set from the master page. I wanted some objects to be invisible/visible here depending on user input. Your replies suggest that this is perhaps not the best option; I have put them at the top of the main area instead, and now it works fine!

Views

88

Likes

0

Replies

0
Show a hidden object on the master page
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
I'm struggling to be able to show a hidden object (text field) on the master page, when I select an item from a drop-down on a standard page. The item shows initially, but the next time there is an action to show a different area on a standard page, the hidden object on the master page disappears again! Any idea why this is happening, and how to fix it?

Views

125

Likes

0

Replies

3
Re: LC crash on save - cannot recover form
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Radzmar, yet another invaluable suggestion from you - you saved me a ton of work after the app crashed! Thanks!

Views

21

Likes

0

Replies

0
Betreff: Script to calculate number of days between 2 dates
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Many thanks, that fixed it! One more question - how can I change the way the date displays in the boxes? Instead of Aug 31, 2020, I would like it to display Monday August 31, 2020. If I change it, then the calculation no longer works. Do I need to change it in specific areas?

Views

83

Likes

0

Replies

0
Betreff: Script to calculate number of days between 2 dates
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
It works on your PDF, but if I copy that subform into my document, it gives a number in the 44,000's ?

Views

118

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Thanks kprokopi - the script works fine on the form you sent. But when I copy and past those 3 fields to my own form, it does't work and I get a huge number! Yours: https://imgur.com/gallery/9ucexUm Mine: https://imgur.com/gallery/NLojPoo I also looks like the date format is different in the 2nd box - I don't why this could be, as I just copied across from your form to mine! Edit: this should have been a reply to the other thread about the 2 date fields, sorry! I've commented there also.

Views

143

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
CHI is actually a text field already! I'm not sure why I said it was a numeric field, sorry! I actually got it working on the advice of radzmar, though I still need to set a validation pattern to make sure that the user enters a 10 digit number.

Views

163

Likes

0

Replies

0
Betreff: Script to calculate number of days between 2 dates
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Thanks for that! But with a current date of 28 August 2020 and an field 2 date of 26 August 2020, I get a calculated number of days of 44,068!

Views

140

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
You're right radzmar, they're both in the same subtree. I think I just found the problem - there was a validation pattern set to the CHI field - when I removed this, it works! But now the user can enter the wrong number of digits. I do need a validation pattern to make sure that the user enters exactly 10 digits.

Views

176

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
https://imgur.com/gallery/UU44AM2

Views

192

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
kprokopi - well observed; somehow I had placed it under "calculate" - I changed it to "exit*" - though unfortunately it still doesn't work. You say that "the script must be in the date input field" - I presume you mean the numeric field? The 10-digit number is being entered into a numeric field. That is where I entered the script. I will post a screenshot of the script & hierarchy

Views

196

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
It's set to JavaScript, and I'm pretty sure I have the correct SOM expression - but it's still not working. Do I need to set any particular settings in the numeric field's field or value settings?

Views

219

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Thanks radzmar. I replaced "Textfield1" with "form1.Page1subform.PatientSubform.AgeCalculated" in your script, but no age is outputted. Just to confirm, the first field is a numeric field, and the output field is a text field with value type "user entered - optional"?

Views

236

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Thanks radzmar. I selected the numeric field, and pasted the code above into the script editor ("show" says "calculate"). Do I need to change "Textfield1" in your script to the name of the field that will contain the age? If so, do I just put the name of the field, or do I have to enter all the subforms also (both fields are in the same subform)? Thanks

Views

259

Likes

0

Replies

0
Betreff: Script to calculate number of days between 2 dates
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Do I paste that script into the script editor for the 3rd box? Date 1 is auto-populated and date 2 is user-entered.

Views

168

Likes

0

Replies

0
Betreff: Script to calculate number of days between 2 dates
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Thanks for this reply. In your example you have a date field, and a second calculated field where the number of days is displayed. What I am trying to do however is to calculate the difference between 2 date fields, and display it in a 3rd field. Any suggestions for this?

Views

119

Likes

0

Replies

0
Script to calculate number of days between 2 dates
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
I'm fairly new to scripting and have looked for an answer to this; I have found some posts though have been unable to apply them to my scenario. I have one date that is automatically populated with the current date, and another (earlier) date that the user enters. I need to have a field which calculates the difference between these 2 dates in days.Any help appreciated - I'll use any help as a learning exercise!

Views

242

Likes

0

Replies

11
Betreff: Script to calculate age from first 6 digits of a...
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
Hi, yes I am looking for age - would be very grateful if you could help with that! Also, if you could tell me where to add the script I need that would be helpful too.

Views

115

Likes

0

Replies

0
Script to calculate age from first 6 digits of a 10 digit number (DDMMYYXXXX)
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
I have a "numeric field" which will contain a 10 digit number; the fist 4 digits being the date of birth (DDMMYY). I would really like to have another field where the DOB is automatically calculated from this. I'd appreciated any help - I have pretty much zero knowledge of scripting.

Views

447

Likes

0

Replies

22
Can't get auto-populated current date & time field to show in correct way
Avatar

lostfrogg

lostfrogg
- Adobe LiveCycle
I've added a "Date/Time Field" to my form. In the value tab, type is "calculated - read only". Runtime property is "Current Date/Time". If I go to "patterns" and select a particular type under both "display" and "data" (e.g. April 01, 2007 3:30:47 PM) and click OK, then go to the "preview PDF tab", the data is shown as "2020-08-23 10:08:17". Why isn't it showing the date & time in the way I chose?Also, I want it to show the date & time when the user opens the form to fill it in. I don't want it ...

Views

127

Likes

0

Replies

1