kapdev
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldI am editing the cloned field. Field number 7. I am entering the following:
The only two fieldnames I have worked this on are fieldnames 36 and 37. The HTML contents for them are Fieldname 60 (corresponds to fieldname 37) and fieldname 61 (corresponds to fieldname 36).
The main dropdown menu is fieldname45 > nauseas > fieldname26 > modifical > fieldname61
Fieldname61 (HTML):
<div class=”result-here-modifical” ><div>
Fieldname36:
(function(){ var modifcal= ''; if(fieldname2 < 16) modifical ="No se recomienda este medicamento por no poderse partir la tableta"; else if(fieldname2 <= 30) modifical = "UNA TABLETA de 4 mg vía oral (por boca) una única vez"; else modifical ="DOS TABLETAS de 4 mg vía ORAL (por boca) una única vez"; jQuery('.result-here-modifical').html(modifical); return modifical; })()The other one is Fieldname45 > nauseas > fieldname26 > onsetron > fieldname60
Fieldname60 (HTML):
<div class=”result-here-modifical” ><div>
Fieldname37:
(function(){ var onsetron = ''; if(fieldname2 < 10) onsetron = "No se recomienda este medicamento por no poderse partir la pastilla"; else if(fieldname2 <= 40) onsetron = "1 tableta BUCODISPERSABLE de 4 mg vía oral, una sola dosis. Dejar que se disuelva en la boca. Puede repetir la dosis en 12 horas en caso necesario"; else onsetron = "2 tabletas BUCODISPERSABLES de 4 mg vía oral, una sola dosis. Dejar que se disuelvan en la boca. Puede repetir la dosis en 12 horas en caso necesario"; jQuery('.result-here-onsetron').html(onsetron); return onsetron; })()Thanks
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldI understand. I feel you are being generous with your time. You have responded this many times, I have also asked this many times. I apologize. I feel I haven’t been able to explain my question properly. The issue is on a mobile device. In this case using iOs and Safari.
I have created an HTML content fields with <div class=”result-here-A”></div>, and others using B,C, etc
I have inserted the function that names and assigns value to the variable in the Set equation in a Calculated Field, followed by jQuery(‘.result-here-A’).html(A)
return A; (substituting B, C and so forth)On a computer, the results display without the Calculated Field Title and without the box. It works. On a mobile, it doesn’t. Therefore, the text does not wrap. On a mobile, it ignores the Hide from public view instruction and ignores the HTML content altogether.
I don’t know if I need to use “use strict” or if there is something else going on.
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldThank you! Changing return for A worked! The results display. However, if you view the results on a mobile phone, the text doesn’t wrap. Even though the calculated field is hidden from public view, the results display inside a box, with the title of the hidden field. The results are contained in one line only, therefore, it still doesn’t wrap the text. I am sending the link of the sister page so you can see the results on a phone if available. You may choose nauseas/modifical or nauseas/onsetron to see what I am referring to.
Now the only issue is it still doesn’t wrap the text. How can I fix that?
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated Fieldwhat should I place after return?
Currently it reads:
jQuery(‘.result-here’).html(result)
return result;Should it read jQuery(‘.result-here-1’).html(result)
return result; ?I have tried renaming the variable result for example
fieldname 36 would correspond to var A
HTML:
<div class=”result-here-A”></div>
(function(){ var A= ''; if(fieldname2 < 16) return "First"; if(fieldname2 <= 30) return "Second"; if(fieldname2 > 40) return "Third"; jQuery('.result-here-A').html(A) return A; })()But that didn’t work either. Nothing populates on the page when the option is selected.
Also, I don’t know if this will work because even though it works for one field only (nauseas y vómitos/onsetron), it doesn’t wrap text when I view the page on my phone.
So I guess the first issue to solve would be wrapping text. Afterwards, figuring out how to apply it to multiple fields.
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldHello @codepeople
Unfortunately that doesn’t work. I need to select the HTML field in the dependencies for the dropdown menu so that the result is displayed. If I select the same HTML field for several options, the same result displays (fieldname37), even if I select the option that should display results for fieldname 36, fieldname 37 is displayed. If I select the calculated fields in the dependencies in the dropdown menu, even if the function with var result is placed in the equation section, nothing displays after the option is selected from the dropdown menu.
And when I had the HTML content field selected in one of the dependencies from the dropdown menu, the results would display, but still would not wrap.
I even made a new HTML content field, and tried naming another variable in a different fieldname trying to then direct another option to that particular HTML field, yet it seemed that it still displayed results for the first option that was set up. Option A> fieldname 44 (HTML content). Option B>Fieldname 45 (HTML content). Option A would always display results for Option B. If I set u Option A>fieldname36 and Option B>fieldname37, no results would display.
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldHello @codepeople
Unfortunately that doesn’t work. I need to select the HTML field in the dependencies for the dropdown menu so that the result is displayed. If I select the same HTML field for several options, the same result displays (fieldname37), even if I select the option that should display results for fieldname 36, fieldname 37 is displayed. If I select the calculated fields in the dependencies in the dropdown menu, even if the function with var result is placed in the equation section, nothing displays after the option is selected from the dropdown menu.
And when I had the HTML content field selected in one of the dependencies from the dropdown menu, the results would display, but still would not wrap.
I even made a new HTML content field, and tried naming another variable in a different fieldname trying to then direct another option to that particular HTML field, yet it seemed that it still displayed results for the first option that was set up. Option A> fieldname 44 (HTML content). Option B>Fieldname 45 (HTML content). Option A would always display results for Option B. If I set u Option A>fieldname36 and Option B>fieldname37, no results would display.
Please help.
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldThanks, I am having two issues:
1. Text is still not wrapping despite the HTML workaround (may best be seen on mobile phone). Only one line is displayed
2. I don’t know how to apply this to other fieldnames as there are several fieldnames with the same issue and needing to wrap text to be able to read entire result.Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldThank you so much for speedy and effective service!
This worked, but the text isn’t wrapping. It is displaying as one line only, better appreciated on a mobile phone.
How can I apply this to other fields with the same issue (Long sentences as result of the equation)?
- This reply was modified 5 years, 1 month ago by kapdev.
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldIf I need to do this for many fieldnames, can I use the same function with only one HTML content, or do I need to create an HTML content field with a different class name for each one?
I tried copying the same formula into a sister page I am working on, but it didn’t work. I have attached the link.
- This reply was modified 5 years, 1 month ago by kapdev.
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldYou’re right! I had it right at first but changed it since I thought it was backwards after reading the message. It worked! Thank you so much!
Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldForum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldI didn’t paste de equation into HTML.
I copied this into HTML:
<div class=”result-here”></div>
And this under Set Equation in Calculated Field, right below the checkbox to hide from public view:
(function(){ var result = ''; if(fieldname23 < 2) result = "First sentence here"; else if(fieldname23 < 8) result = "Second sentence here, and an explanation to go along with it, as well as a suggestion to possible solutions to the problem."; else if(fieldname23 < 11) result = "Third sentence here"; else result = "Fourth sentence here"; jQuery('.result-here').html(result); return result; })()Forum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldForum: Plugins
In reply to: [Calculated Fields Form] Wrapping Text Calculated FieldThank you for your quick response. Unfortunately this did not solve my problem. In case this is relevant, the field which is a calculated field (fieldname37) is referenced from a dropdown menu. If a person selects C, fieldname 37 is shown. As of now, with the solution that was suggested, I click on C on the dropdown menu and nothing happens.