I am having a problem with adding custom keystroke and format scripts into a text field. As it is told in the documents, I right click the field and select properties, go to the format tab and select custom as the format catagory, click one of the edit buttons, write some javascript and click ok. But, nothing is saved. It turns back to the format tab with format category is none, just an empty window. Does anyone know what is causing this problem?
Related
I'm trying to build a Chrome Extension that autofills a website form. The form has several drop down menus. However, these are not coded with the HTML select object. Instead, they're coded with the HTML input text object (see the attached photo) (https://i.stack.imgur.com/6FynG.png).
I'd like to build functionality that mirrors selectedIndex and select one of the drop down menu items.
Is this possible?
I've tried 3 things:
I've used .execCommand to mimic the user typing into the input box to narrow down the number of drop downs that appear. This isn't a complete solution because the user must still click on the drop down menu.
I've used .innerHTML and similar methods to change the websites HTML, so that it matches the output of when a user selects an option from the drop down menu. This makes the website look like the user has selected an option, but it doesn't full work either. As soon as the user clicks outside of the input field, the field revers back to being empty (maybe the form is refreshing?)
I've explored using Selenium, but I don't think it makes much sense here. I'm trying to build a Chrome Extension for other users, rather than automate testing.
My job is to order diagnostic tests for patients and I need to write 6-7 characters value for each diagnostic test. I have 24 different values and I need to fill it many thousands of times. I am thinking to create 24 different scripts with Tampermonkey to speed up my job by clicking on the script box.
So the thing is that I need to fill this
box. Here are the input id and everything of that box in the console. Then I type the value manually, I get popup list which updates every time I type one character (same principle as google or youtube search box), here is the popup list after I type a value and if I want that diagnostic test, I need to click on it from the popup list, I cannot just simply click enter. So this is the code I have to fill the box by a value:
document.body.appendChild(element)
element.addEventListener('click', function(){
document.querySelector("input#generic_test_order_search.ui-autocomplete-input").value = '15002 '
})
The script fills the value, but the popup list doesn't appear and I need to click on the box, delete one character and write it again to get a list and then to choose a diagnostic test from it. Still, time-consuming.
I wonder, is it possible to make a script to add automatically a diagnostic test from the list like this example? If no, is it somehow possible to make that popup list would appear and I won't need to click on the box, delete one character and write it again? At least, could I make that the box is clicked after a value has been filled? I tried this code but doesn't work: document.querySelector("input#generic_test_order_search.ui-autocomplete-input").click()
Please help me to make it as automatic as possible, which would save me hundreds of hours in the long-term.
1 - As for the second part of the question. Picture 4.
It is pretty simple to make an auto-fill for the dropping parametres, we just might need the html-code of the elements.
For example,
document.getElementsByTagName('input')[0].click(); clicks the first input checkbox from the first input
document.getElementsByTagName('select')[0].selectedIndex = 1; selects the second value from the first select
document.getElementsByTagName('button')[0].click();clicks the first button
To make it more precise you might use class at first, at then tag:
document.getElementsByClassName('testClassDependingOnExistingClasses')[0].getElementsByTagName('button')[0].click(); for example.
Anything you do manually on a page like that can be done automatically with JS.
2 - As for the first part of the question. Picture 2.
Here is the part of the answer.
How to trigger arrow down press in js?
Maybe this code might help, but not enough information, since no data on html-code of the dropped elements.
document.getElementById('generic_test_order_search').clildren[0].click();
Lets say we inputted the values 'abacadabra' and 'chimichanga' in the form field
The autocomplete of the browser shows these values when we start to input 'abac..' or 'chimi..'
Can I check the values that was already inputted in the form in some internal variables???
If you're asking if there is a way for a website to retrieve these values, there is not. It would be a HUGE privacy breach and vulnerability.
If you're asking if there is a way for YOU to see these in your browser, often your browser has a setting where you can see these.
For Firefox, this Support Forum question leads to a plugin that allows you to edit your form history.
For Chrome, this PC World article goes step by step on how to find and delete specific entries.
Click the Chrome menu on the browser toolbar and select Settings
Click “Show advanced settings” and find the “Passwords and forms” section
Select Manage Autofill settings.
In the dialog that appears, select the entry you’d like to delete from the list. Click the “x” that appears at the end of the row.
I'm currently handling with a problem. I need to make like a form to create something like this:
So, I'm trying to make a form with a Slack's Dialog but my problem is that only supports 5 inputs, this is my current process:
Is there another way to input text or dropdowns and return that kind of format ? or how can I add more inputs (5+) to a dialog ?
No, you can not have more than 5 inputs in your Slack Dialog. Its the current upper hard limit.
Dialogs are the best way on Slack for structured text input. But you could also use text input from a slash command, e.g. /command "first input" "second input"
You can also create drop downs with message menus
To solve your problem of needing to query more than 5 inputs from the user in Slack I think you have two options:
A. Use multiple Dialogs, e.g. you appear to have 9 field, so you
could first open a Dialog for the first 5 elements and then for the
last 4 elements.
B. You mix Dialogs (for text input) with message menus for drop down
input and/or a slash command, e.g. use a Dialog for the text input and main options. Then show the result as Slack message and allow the user to change the remaining options wit message menu.
Update July 2017
You can now use up to 10 elements per Dialog. See here for details.
Currently the limit is 10 for each dialog. In case you need to retain the state of the previous dialog, or want to get the previous dialog input values in the next dialog submit processors, you can use state field in the dialog attachment. The state field take values as text and you can possibly put a delimiter like below:
"state": "input1|input2|inout3...|input10"
and get the values in the next dialog processor.
I'm using a form where in a text box is bound to a variable object by its path. I also have a button to fetch few records based on the input given in this text box. When I enter something for the first time and hit the button, it fetches the records. But again if I try to hit backspace or delete buttons inside the text box, it takes me to the previous page instead of simply deleting the text inside. Is there a way out? I tried with events like preventDefault() using keyCode restrictions, but in vain. Please help.
PS: This text box has regex validations and also has logic to pre-populate.
when records are fetched, you lose the focus on your text box. When you press the Backspace key once more, the browser takes you to the previous page (as most browers do). Set the focus back on your element after you fetch the records or change you code so the records fetching will not change the focused element.
See : https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.focus