Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
Your vedio did not play.
Copy link to clipboard
Copied
here is the link
Copy link to clipboard
Copied
Please use vlc player after downloading the video to play it correctly
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
Just remove the "\n" part from the code...
Copy link to clipboard
Copied
If i remove "\n" then both the options will be in the same line..
i want
like
this
Copy link to clipboard
Copied
You will get the gap when you use "\n" + "\n"
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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....
Copy link to clipboard
Copied
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");
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
Did you use exactly the same code as I posted?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
Here is the link of the video
https://www.dropbox.com/s/wdw8p889bx8nmyo/ScreenCapture_12.flv?dl=0
Copy link to clipboard
Copied
That's not what I asked for.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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);}
Copy link to clipboard
Copied
This is not mine script.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now