Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using Action Button to generate "Notes" in a Text field with dynamic formatting

Engaged ,
Dec 19, 2016 Dec 19, 2016

I am making a medical form in which i have text fields which generates notes based upon the form fields selection.

Dropbox - ScreenCapture_12.flv

First of you plz see the video from the above link.... i am getting everything right.. except for the problem in the video....the problem is .... when one doesnot choose the continous check boxes there is a one line gap between the two options (plz refer the above video link)............I want that when any of the checkbox is checked the there should not be a  line gap.. as is the case in the video.

Below is the java script which i am using:

this.getField("subjective").value = "SOAP Notes\n" + "\n"+ "Chief Complaint\n" + "\n" + "Mr. " + this.getField("member.name.last").value + " is inquiring about utilizing orthotic bracing for his current conditions. His chief complaint at the time of this assessment is: " + this.getField("consult.chief-complaint").value + "\n\n" + "Subjective Notes - Information Reported by Patient\n\n" + "On a 0-10 pain scale" + "; " +  "the patient describes his pain as being at a level "  + this.getField("dme.pain-level").value + ". " + this.getField("location").value + " pain has been constant for " + this.getField("dme.length-of-pain").value + " months.\n\n" + "Mr. " + this.getField("member.name.last").value + " chief complaint is " + this.getField("area.pain").value + " pain, which he reports is associated with a level " + this.getField("dme.pain-scale").value + " pain on the 1 to 10 severity scale. The patient also says that " + this.getField("blankfield").value + " aggravates the condition" + "," + " temporarily resulting in higher pain levels on the severity scale.\n" +  "\n"+ this.getField("member.name.first").value + " has indicated that his back pain makes it difficult to walk.\n\n" +

"Objective Notes from Treating Physician\n\n" + "My consultation with " + this.getField("salutation").value + " " + this.getField("member.name.last").value + " today, a/an " + this.getField("member.age").value + " years old, " + this.getField("member.gender").value

+ " was in regard to his complaint of " + this.getField("location").value + " pain. " + "This a " + this.getField("dme.pain-level").value + " level " + this.getField("dme.pain-scale").value + " pain, but is made even worse when aggravated by " + this.getField("dme.worsen-pain").value + "." + " I consider this to be caused by general weakness, due to a pre-existing condition resulting in the current level of pain and discomfort for an extended time.\n\n" + "Assessment Notes\n\n" + this.getField("Text1").value + "\n" + this.getField("Text2").value + "\n" + this.getField("Text3").value

The above in red text are the check box values which should be listed without space .. irrespective of the selection of any options.. continuous or non-continuous

TOPICS
Acrobat SDK and JavaScript , Windows
3.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Dec 20, 2016 Dec 20, 2016

Yes , this is your script....

You should use something like this:

var txt = "";

if (this.getField("Text2").value != "") txt = "\n" + this.getField("Text2").value;

Then add txt to your subject.

Translate
LEGEND ,
Dec 19, 2016 Dec 19, 2016

And if one of the text fields is empty, null sting, or has a space what do you want to heppen?

Right not is is inserting the line with the null or space character.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 19, 2016 Dec 19, 2016

Plz see the video ... when i choose the first three checkboxes... .three options a listed ..... but when i choose only two or only one of the three checkboxes....... there is space between the line......  i want if any of the checkboxes is checked.. there should not be any gap between two options..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 19, 2016 Dec 19, 2016

Your vedio did not play.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 19, 2016 Dec 19, 2016
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 19, 2016 Dec 19, 2016

Please use vlc player after downloading the video to play it correctly

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 20, 2016 Dec 20, 2016

When you uncheck an option the text field is cleared so if one accesses the field there is no valuebyo display but your script tries to display the empty field and terminates that value with s new line before showing the next field.

Again, how do you want fields with null vslues handled?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

i just want that even after unchecking the checkbox... the text displayed in the text box should be in continuous lines.... in simple words there should not be a gap in between...... irrespective of whichever checkbox is checked..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

Just remove the "\n" part from the code...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

If i remove "\n" then both the options will be in the same line..

i want

like

this

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

You will get the gap when you use "\n" + "\n"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

that is the problem if i use "\n" then there is a gap between the options.... and i remove "\n"  they all come in the same line..... i want them to in different lines.. irrespective of whichever checkboxes is checked..... continuous or non-continous

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

Looks like i have not been able to explain what i want..... i request you to plz see the video in the original question.

Let me explain again..

Let the checkbox options be :

1st checkbox :  I

2nd checkbox : want

3rd checkbox : like

4th checkbox : this.

case 1 when all the checkboxes are checked then the text be as below:

I

want

like

this

Case 2

when 2nd checkbox is unchecked then there should not be any gap between 1st and 3rd checkbox.

I

like

this

case 3  : when 2nd and 3rd option are not checked then also there should be any gap between 1st and 4th in the output text:

I

this

case 4 and so on... in nutshell there should not be line break between the two output text....

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

Not the prettiest solution, but it should work:

(this.getField("Text1").value + "\n" + this.getField("Text2").value + "\n" + this.getField("Text3").value).replace(/\n{2,}/g, "\n");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

this only works for the text3..... if text 2 is unselected then only text3 goes up.......... if one deselects text1, text 2 and text3 doesnot go up..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

Did you use exactly the same code as I posted?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

Yes i used exactly the same code....but it doesnot work............If 2nd checkbox is unchecked the 3rd checkbox goes up..... but when 1st checkbox is unchecked... neither 2nd checkbox goes up nor the the 3rd checkbox

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

Can you share the file in question (via Dropbox, Google Drive, Adobe Cloud,

etc.)?

On Tue, Dec 20, 2016 at 3:38 PM, rakeshk21205956 <forums_noreply@adobe.com>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

That's not what I asked for.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

You should use something like this:

var txt = "";

if (this.getField("Text2").value != "") txt = "\n" + this.getField("Text2").value;

Then add txt to your subject.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

the above script is showing syntax error.

"Assessment Notes\n\n" + if (this.getField("Text1").value != ""){txt = "\n" + this.getField("Text1").value;} + if  (this.getField("Text2").value != "") {txt = "\n" + this.getField("Text2").value; }+ if (this.getField("Text3").value != "") {txt = "\n" + this.getField("Text3").value);}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2016 Dec 20, 2016

This is not mine script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 20, 2016 Dec 20, 2016

Yes , this is your script....

You should use something like this:

var txt = "";

if (this.getField("Text2").value != "") txt = "\n" + this.getField("Text2").value;

Then add txt to your subject.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 20, 2016 Dec 20, 2016

There obviously is more going on in your form than the script that you posted. There appear to be at least 3 check boxes that adjust the value of some of the fields in the script that you posted.

You have been asked to post a accessible link to the form or if you feel your form is so personnel a sample of the form or section with your problem, se we can have access the all the scripts. There are possibly many other things going on here that you might not be aware of but some of may have experience with. The most common being the order of calculations used in the form.

You might get more help by posting the link and you could possibly in return get a copy of a working form.

It also appears that the action you are trying to accomplish might be repeated several times in the form might benefit from some custom functions. Also if this form is going to be used on Mobile devices like tablets, there are many restrictions imposed by the device and app so you will not to extensive testing on these non-computer devices and the PDF viewer app being used.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines