SweetAlert2 reacts differently to keypresses for input type text vs textarea - sweetalert2

In SWAL2, if input: 'text' is set, one can type in text but the confirm button is also triggered when pressing enter - a perfect combination.
But for input: 'textarea', all keypresses end in the textarea, and Enter doesn't confirm the alert.
How can I have the Enter key (Or Shift+Enter, or Ctrl+Enter) confirm the alert regardless of input type?
One more detail, allowEnterKey and focusConfirm are already explicitly set to true.

Related

Laravel Livewire text input with 2 submit buttons

I have a small problem that I cannot resolve because im new to Livewire
I have a form with a text input with a search button.
The user types a word, press enter and the search button finds the result on database... and with that result I enable the save button.
when the user press enter again I save that word on a table.
the problem later is when the user change that word. I press the enter key again and it tries to save and not to search the word...
how can I reset or something when the text input change? without executing it on every key press?
thanks !!
I have found my answer.. it was not on hydrate or dehydrate.. it was on updated function of the property, where I reset all inputs.
thanks for you and me

Capybara HTML 'number' attribute interaction

I'm testing a webpage that has two input fields of type number. When I hover over a field, two arrows, up and down, appear to increase or decrease the value in the field.
Is there a Capybara script that would click these arrows?
I can use a standard fill_in function to change the value, but I would like to automate clicking the arrows to change the value.

AutoHotKey - Using Presence of Data In a Text Box to Set Correct Radio Button

One of my data entry scripts has multiple GUIs that prompt the user to answer a series of questions, and based on those answers, generates a template in Notepad to be copied and pasted into the Remarks section of a program to send appointment orders to a contractor.
Some of the GUIs I created have just a Yes and No radio button, but others have a Yes and No radio button along with a text box to enter additional data. For example, one GUI asks if there are upcoming appointments at our clinic. The default radio button is No so the user can quickly skip to the next GUI in the series, since the Next button at the bottom of the GUI is set as default.
If the user leaves the No button as-is, at the end of "20 questions" as the script prints out the the template based on the answers, the script writes out "Upcoming appointments: None"
If the user selects Yes and enters data in the respective text boxes, the template writes the "Upcoming Appointments" banner line, two {Enter} commands, the list of appointments, followed by two more {Enter} commands to leave space between Appointments and the following section.
Example:
If ApptsRadioButtonYes = 1
{
SendInput >{space 2}>{space 2}>{space}Future Appointments - Do NOT Schedule On This Date{(}s{)}{space}<{space 2}<{space 2}< ; Top-of-section banner line
Send {Enter 2}
Send %Appts_Info% ; list of appointments entered in text box
Send {Enter 2}
SendInput >{space 2}>{space 2}>{space 2}>{space}<{space 2}<{space 2}<{space 2}< ; End-of-section banner line
Send {Enter 3}
}
Else If ApptsRadioButtonNo = 1
{
Send Appointments pending: None
Send {Enter 3}
}
The flaw is, with the default set to No, if the user enters info in the text box but forgets to change the radio button to Yes, the script ignores any next-of-kin information or appointments info and prints out a line of text at the end of the script as ""Upcoming Appointments: None" or "NOK: None."
Conversely, if I set the default to Yes but the user did not enter anything in the text box, the script would print "NOK: " with nothing following. The same sort of thing happens with the upcoming appointments GUI, but a little more confusing: the script prints the "Upcoming Appointments" banner line, a blank line, another blank line (where there should have been an appointment), and two more {Enter}.
Is there a command I could use that would change the radio button to Yes if there is data in the text box, something along the lines of (in psuedo code):
If UserData is not blank
{
Set RadioButtonYes to 1
Set RadioButtonNo to 0
}
This way, if there is data and the user forgets to set the appropriate radio button to Yes, the presence of data in the text box takes care of the correct setting, and the appropriate heading plus the data is written.
Alternately, I could just change GUIs like that to just Yes/No, and if the answer is Yes, another GUI would pop up to get the data; if the answer is No, it would continue on to the next Yes/No GUI. I would rather keep the number of GUIs down to a manageable size and confined to one topic each. I could even just combine everything into one GUI, but that might get a little "busy."
Thanks!
You can launch a subroutine automatically whenever the user types something into the edit field:
A g-label such as gMySubroutine may be listed in the control's
options. This would cause the MySubroutine label to be launched
automatically whenever the user or the script changes the contents of
the control.
(documentation)
In my following code example, this is represented by the gcharTyped keyword, meaning "Jump to label called chartyped".
gui, 1:add, radio, vApptsRadioButtonYes group, Yes
gui, 1:add, radio, checked vApptsRadioButtonNo, No
gui, 1:add, edit, vUserData gcharTyped w150 h150
gui, 1:add, button, gsubmit, submit
gui, 1:show
return
submit:
gui, 1:submit
if ApptsRadioButtonYes = 1
msgbox, Yes!
else if ApptsRadioButtonNo = 1
msgbox, No!
exitapp
return
charTyped:
; change the state of the first radio button to CHECKED:
; also unchecks all remaining radio buttons from the same group
GuiControl, 1:, ApptsRadioButtonYes, 1
return
1guiClose:
exitapp
return

WebDriver: How can I test that a button is clickable only if there are no invalid values entered?

I'm doing some UI automation testing at work and I'm not quite sure how to do this
I have a form that asks for a user's name and date of birth before they can click a button to the next page. If they enter anything with invalid characters (a name of '1111' or a DOB in the future) the input boxes are highlighted in red and an error message appears. How can I test that the 'continue' button is clickable only once valid input is entered?
Actually, in my project, there are many many "type-of-button".
It can be an input-tage , span-tag or even image!
So in my opinion, you can't verify that button can be clickable.
You should verify what system does after you click on this button for example: page is loaded, image is uploaded...
Hope it helpful :)
First scenario :
Username: Valid
Password: Valid
button is displayed
use the driver.FindElement(By.Id("id/xpath of the button ")).Displayed returns true (C# code )
for java there is similar display
else
you enter the invalid scenario
button is not displayed
the above code would give false
Hope this clears your doubt

Oracle Apex submit when 'enter' pressed

I have an text field in an oracle apex form. A user can type in a search query and hit the "Search" button to submit the page. I also want to allow the user to just be able to hit the enter key to search.
On the text field I have the option "Submit when Enter Pressed" set to Yes. However this is not working. I think it is because I have other processes attached to other buttons on the page that are used to also submit the form for other purposes.
My question is, is there anyway to define specifically what process gets called when enter is pressed from a specific text field?
When you submit a page by pressing Enter in an item with "Submit when Enter pressed" set to Yes, the page is submitted with the Request value set to the name of the item. You can therefore make the process conditional on the value of Request being the item name.

Resources