Contact form 7 submits form when pressing enter/return key - contact-form-7

I have been searching for an answer with no luck so far and I'm no code expert, so there are some things that may have a solution but I simply son't get them.
Contact Form 7 Form on my new website has 2 issues I want to check and solve:
When hitting Enter/Return key the form is automatically sent so if a person is typing a message, they cannot continue writing.
There's no way I can make the text area look higher or have multiple lines so the person sending a message can hit the enter/return key to continue writing in the next line.

I think the solution is by using the textarea shortcode
Textarea:
Both textarea and textarea* are for a multi-line input and accept any form of text. textarea* is a required field.
Example:
[textarea your-message 40x10 "your message here ..."]
Source: https://contactform7.com/text-fields/

Related

Pressing Enter on a date input in Cypress

I have an app with some input fields that I'm trying to automate. The gist of these fields is that I should be able to double click a field, type in a new value, then press Enter to submit that value, which sends a PUT request and also closes the input field. This works for any input type except date.
So far I've tried:
Using cy.type('{enter}'). This gives Typing into a date input with cy.type() requires a valid date in the format 'yyyy-MM-dd'. You passed: {enter}
Using cy.trigger() to send out a keydown event for the enter key. This works, as in it closes the input field successfully but it somehow doesn't send the PUT request.
Pressing enter on the parent Element. Same as using cy.trigger()
Strangely enough, manually opening the input field myself, typing a date and pressing enter will send the request just fine. It seems to me like there's some issue with programmatically pressing enter to submit the field without Cypress interpreting this as my attempt to actually type an invalid character into the date field. The docs do specifically say that no special characters are allowed in a date field.
Can't post any code as this is corporate.
I have tried to let it work, but it simply can't be done at the moment. Something like this should work:
it.only('test', function () {
cy.visit('https://www.html5tutorial.info/html5-date.php')
cy.get('input')
.type('2009-12-12')
.type('{enter}')
})
But it doesn't so I started to dig into the pile of issues and found this one:
https://github.com/cypress-io/cypress/issues/3405 . It is about a different input type, but I believe it is related to your problem.
Unfortunately this problem is still present in Cypress 9.5. One possible work-around is to directly trigger the Javascript keyup or keydown event that you are listening for.
cy.get('input')
.type('2020-01-01T12:00')
.trigger('keydown', {
key: 'Enter',
});
This works for me, but as you pointed out might not in all situations. It depends entirely on how your app is listening for Enter in the first place and on which element.
Another possible option is to call .submit() on the form that wraps the input. If you're testing a component, you could create your own wrapper component that contains a form in order to trigger the submit.
You should remove 'date' attribute like below:
cy.get('input').invoke('removeAttr','type').type('2009-12-12{enter}');
I used something like that in my code, and it worked properly
cy.get('get-your-input').invoke('removeAttr', 'type')type('2022-12-01{enter}').trigger('change');
cy.get('get-your-input').invoke('attr', 'value', '2022-12-01').trigger('change');
cy.get('get-your-input').invoke('attr', 'type', 'date');
Please add date plus enter keystroke in the type: cy.get("#date").type("02-02-2022{enter}");

SuiteCRM turn ON autocomplete on email recipient field

I'm trying to remove the autocomplete="off" attribute from the input field for the email recipient field
The code of the input field is as follows:
<input
class="ac_input yui-ac-input"
size="96"
id="addressTO1"
title="An"
name="addressTO1"
onkeyup="SE.composeLayout.showAddressDetails(this);"
autocomplete="off" type="text">
Is there a setting that can be accessed via the GUI that changes the behaviour of the email "to" field or what would be the best way to turn on the autocomplete functionality.
Just removing it does not work, as there is some javascript functionality there, that keeps bringing it back.
I'm using suiterCRM version 7.6.5
Sugar Version 6.5.23.
There is no GUI for changing that, the autocomplete=off is hardcoded.
The TO field (addressTO1 dynamically generated name) is not a regular text input field, it will support multiple emails separated by comma, so a autocomplete="email" will not work.
The only solution I could come up with is for you to create a javascript function and attach to the keyup event of the field and show your logic.
Also you will need to save previously filled input with the answers and provide a mechanism to delete that. Not an easy solution I am afraid.

vscode extension how to display a form

I wish to create a VSCode extension with an entry form on it - some way of input. So far I have only seen document processing or output for an extension.
How can you display a form of input fields in a vscode extension?
How much data do they need to enter? If it's not much, you should be able to handle it with a series of InputBoxes
From https://code.visualstudio.com/docs/extensionAPI/vscode-api
showInputBox(options?: InputBoxOptions): Thenable<string>
Opens an input box to ask the user for input.
The returned value will be undefined if the input box was canceled (e.g. pressing ESC). Otherwise the returned value will be the string typed by the user or an empty string if the user did not type anything but dismissed the input box with OK.
Parameter Description
options?: InputBoxOptions
Configures the behavior of the input box.
Returns Description
Thenable<string>
A promise that resolves to a string the user provided or to undefined in case of dismissal.
The Visual Studio Code API does not have any native methods to display forms to collect input. You can however, chain together Input Boxes, Quick Picks, etc... You can find all these methods under vscode.window.(...).
If these do not satisfy your needs you can implement a webview which allows you to render integrated HTML in Visual Studio Code and trade messages with the extension.
The most simple aproach would be to simple send all collected data from the form to the extension once you hit the submit button or something similar.
You have a nice little tutorial on how to do that here.
Another approach is to see how far you can go with editing JSON objects in settings.json. I thought I would need a form for 8-10 fields, but it turns out that I can create a settings template that has a series of labels and and entry fields (with type validation).

WYSWIG editor with autocomplete/hashtage replacement

I'm trying to implement tag-replacement/autocomplete functionality with usage of CKEditor or Summernote, but after a few days of smashing my head into the wall I haven't moved forward at all.
The problem:
user types # in the editor which opens a autocomplete list, during typing list is filtered according to what is typed in
when user selects one of the option the # with linked text is replaced with longer text
user is able to continue writing without having to focus the editor after selecting the hashtag text
example:
array(
"welcometext" => "Dear user welcome in our system",
"footertext" => "Hope to here from you soon"
)
The two problems that I have with this are
- making any autocomplete to work in any way
- created simple ckeditor plugin that was replacing hastags with hardcoded text, but after replacement focus was lost
Any help will be appreciated.
did you try this solution?
CKEDITOR.replace('fieldToReplace',{
on: {
'instanceReady': function(e){
CKEDITOR.instances[fieldToReplace].focusManager.focus();
}
});

javascript in zend_Form_Element_Text

I have an autocompexion app. that works. Server side written in php (search.php)
. Client side in javascript (autocomplexion.js).
In a text field this helps to enter town name by giving towns names that starts with the same letters that are entered in the field.
search.php sort a list of towns in towns.txt and choose the ones that match.
autocomplexion.js helps to select among those proposed towns.
My issue :
In Zend i would use this in a form (zend_Form) in a text field created with Zend_Form_Element_Text.
How do i link this field with autocomplexion.js and search.php.
where do i put search.php and autocomplexion.js
Thanks for your answer
Patrick
Write the PHP search function in an Action in an appropriate controller. Point the JS to this action and I think you are done.