A textfield with a restriction of columns und rows - javascript

I want to create a preview field for a text which I want to print later. The text in the preview is written by the user. The thing is that the text is not allowed to exceed over 7 rows and 33 columns (I defined those 7 rows and 33 columns in my textarea where the user inputs his text). In short: User writes text which gets submitted to the webservice -> text is saved in database -> on request the text will be shown on the html site and printable, condition: the text is not allowed to be larger than the 33 columns and 7 rows. I wanted to use a text field for this task now where I can define this special height and width, so that the text which overflows is simply not display, so that the user recognizes that there is too much text written. If there are understanding problems please tell me :)

You should use maximum number of length for text, instead of setting a certain number of columns and rows in textarea.
If you are interested in using maxlength then have a look here: How to impose maxlength on textArea in HTML using JavaScript and Limit number of lines in textarea and Display line count using jQuery.

Related

Text to Speech - highlight the read word when it is being Spoken and track speak progress

1]: https://i.stack.imgur.com/USZOJ.png
My Requirement is i want to copy paste data to this textbox. after copying text its formatting should not change,
one should be able to change the font size , font etc.
If data contains paragraph and table then it can be pasted in
its own format.
Text color and table border color in the textbox should be changed to
white irrespective of original format color.
Table layout should not get disturbed in textbox.
**
i have found solution on this and i have achieved it in web based
TinyMCE editor and JavaScript, i am using window speech synthesis to
read the copied data in to the editor , when i click on read button
it reads the data but i need to highlight the read word when it is
being Spoken
**
There are two main ways to get the job done:
Using the HTMLBody property of Outlook items which returns or sets a string representing the HTML body of the specified item. The HTMLBody property should be an HTML syntax string.
Using the Word editor. The WordEditor property of the Inspector class returns an instance of the Word Document which represents the message body.
See Chapter 17: Working with Item Bodies for more information.

How to allow a hex code to be inputted into an existing dropdown list of values- Data validation (Google sheets/apps script)

To summarise, I have a column called "Color" - I need a dropdown list that accepts a value (red,blue,green etc) by selecting a colour from a pre defined list and also for ANY hex color code to be inputted manually into a cell by the user - Currently the user is getting an invalid flag when inputting hex codes as hex codes are not in the data validation list for the drop down.
Is it possible to set up a dropdown list programatically using app scripts and for the dropdown validation to allow a hex code or colours.
Please test to add Query under last range of your list range like this (validation in DestSheet or as your actual sheet you used):
=query( arrayformula( if( isnumber(DestSheet!B2:B),text(DestSheet!B2:B,"0"),DestSheet!B14:B)),"select Col1 where Col1 like '#%'")
and change your validation (Range List), for example your range for list is in SrcSheet, write this:
SrcSheet!A1:A

Trying to calculate a percentage of possible answers that have been selected in a pdf

I have multiple forms that all follow a similar format, and that are exported from an InDesign table into Acrobat DC and then prepared as fillable forms. These track a student’s progress with a series of tasks (lines of text from the original InDesign file) and a rating of either 1, 2, or 3 (prepared as radio buttons with 3 choices) for each task.
I need to create a field to calculate the percentage of radio buttons that have been chosen (i.e., if there are 10 lines [hence 10 radio-button sets] and 4 have an entry choice selected, the field I want to create would return “40”--4 out of 10 radio-button-sets have a selection made=40%). I would LIKE to be able to calculate this percentage based on only those button choices that are a “2” or a “3” (passing grades), but I could eliminate the “1” choice and turn that into a check box, meaning that the script would only need to act on “any choice selected” instead of 2 out of the 3 choices.
Acrobat DC allows for a text box to be designated as a calculated field using JavaScript, but I have never even tried to use JS before.
Can anyone help me with a script that will divide the number of radio buttons that have a choice selected (n) by the total number of radio buttons (t), and then return that percentage (%) [n/t=%]? Since the line on which this field will be placed already has a percentage sign already in place (in the original InDesign text), it would be ideal for this percentage to be returned as a whole number (in the above example, “40” not “40%” or “.4” but I can remove that sign if I must.

How to resolve unicode issue with javascript length?

I have angular tooltip for character counter but here i am facing some issues when user copy paste text and add some ascii characters that are not aligned with the java and orcale length when we post the data to the backend, Lets say if user have # in the text it will count lenght as 1 but backend side it will count as 4 because of the way oracle and java works with bytes.
So i am trying to resolve two issues.
1- when i paste text it character counter should count same unicode as java ?
2- It should not remove characters from the text ?
main.html
<textarea rows="2" class="form-control"
ng-model="processDTO.processStatementText"
name="processStatement" id="processStatement"
placeholder="Process Statement" maxlength="4000" required
data-tooltip-html-unsafe="<div>{{4000 - processDTO.processStatementText.length}} characters left</div>"
tooltip-trigger="{{{true: 'focus', false: 'never'}[processDTO.processStatementText.length >= 0 || processDTO.processStatementText.length == null ]}}"
tooltip-placement="top" tooltip-class="bluefill">
</textarea>
main.txt
2. Upload Template Header – Risk Causal and Impact comments are color coded as mandatory but they are optional. Similary the Originating Source System Process/Risk/control ID
3. In the upload template, for any of the multi value fields, I use an invalid delimiter ‘:’, Eg: 13:7 , for some reason this changes the cell format to time format and thereafter I am not able to give any single values, its always converted to time format. Not sure if this is a training issue, but want to put it on the table to see if it requires any fix at all
4. In Upload, for the grid field length validations, the filter doesn’t works on Row Number and Max Allowed columns. ~!##$%^&*()_+|}{:"?><,./';[]\=-0987654321`
5. ERH All levels added in the View End to End ERH screen – Sort and Filter doesn’t works, After clicking on this field, none of the other filter/sort works on the page. Also the sort indicator(black triangle) is not visible, I believe the column width needs to be adjusted.
6. The Risk/Control reference id is seen on the Process Search grids, but when I search by Risk/Control, I don’t see the corresponding control/risk grid having the ref id column however tool tip has it
7. The label change “Originating Source System Process/Risk/Control ID”"

Trying to replace a textarea with better option

Can't seem to figure out the best way to do this.
I am passing through some text to a textarea, but the text is formatted in a mimic of a column format as such:
Text Value Comments
Text2 Value Comments
Longtext Value Comments
etc...
My users take the text from this area and copy/paste it into word. As you can imagine, the attempt at column formatting becomes distorted.
Is there a better way to create this column type of text data set, instead of within a textarea?

Categories