javascript – How to Make addEventListener work on submit

am having problem making this to work on submit
it works well when using

document.getElementById("gets").addEventListener("click", b_button);

but not workng when i use

document.getElementById("gets").addEventListener("submit", b_button);

is there away to make it work on submit than using click

    <form method="post">
              <button type="submit" id="gets">Submit</button>
             <p id="error"></p>
       function b_button() {
    document.getElementById("gets").disabled = true;
    var time_meter = 10;
    var runTimer = setInterval(function() {
        if (time_meter <= 0) {
            document.getElementById("error").innerHTML = "";
        } else {
            document.getElementById("error").innerHTML = 'counting ' + time_meter;
        time_meter -= 1;
    }, 1000);
    setTimeout(function() {
        document.getElementById("gets").disabled = false;
    }, 10000);


document.getElementById("gets").addEventListener("submit", b_button);

Should submit button colors match color scheme or be consistent across products?

The consistency of the design is not done by the choice of colors or its quantity, but by the design itself. The color is just one more component within the design guidelines.

If you define color variability in the design guidelines as a design component, the color change in the buttons can be an element of manifestation of this variable, provided that the shape of the buttons is sufficiently personal and recognizable.

A clear and extreme example of the use of different colors in design is the Carrefour supermarket logo. Although one of the basic canons in corporate image is the consistency of unique and representative colors, when Carrefour presented its new design in 2009, it did so with a considerable number of gradients to be used in its differents communication needs.

enter image description here

Page from the Carrefour Brand Book

views – Remove one of the two “Apply to selected items” submit buttons with Node Bulk Operations

If you make a view and add the Node operations bulk form, two “Apply to selected items” boxes are automatically generated like this:

two apply to selected items boxes

How do I get rid of one of these?

I turned on twig debugging, but the template that is outputting the button is core/modules/system/templates/container.html.twig, which is not something that I can easily customize to remove one of the buttons.

How I created the view:

  1. Create a new view of content showing fields.
  2. Add Node operations bulk form under Fields.
  3. Save the view.

ios – How can we submit flutter app with manual provisioning profile?

I have configured Provisioning Profile for the iOS platform manually. The app is built in flutter. Now I am not able to submit the app to the AppStore. How should I suppose to configure it manually to make sure the apps are submitted successfully.

I am facing the below issue in app submission

Warning: unable to build chain to self-signed root for signer "iPhone Distribution: Johnny(*********)"
    /Users/johnny/Downloads/chat_app-master 2/build/ios/Release-iphoneos/ errSecInternalComponent
        Command PhaseScriptExecution failed with a nonzero exit code
        note: Using new build system
        note: Building targets in parallel
        note: Planning build
        note: Constructing build description

How to disable/hide submit button in webform based on a computed_twig element’s value

(sorry for the length of this message, I tried to provide a concise decription of my problem in order to make it easier for people to understand and help)

Hello all,

I have a webform comprised of 3 pages (two pages of input and a custom preview page).

I explain the whole webform in order to make my question more concise:

My first page has 4 inputs, all required (1 text field, 3 select fields). This works fine.

My second page is a little bit more complicated.

It has three ‘triples’, each triple consisting of: one checkbox, one select, one number.

None of these is required. The logic is that when one checkbox is checked (default value is unchecked), the subsequent select and number will be enabled, otherwise they are disabled (default).

You can find the code for one of these triples in the end of my post – the other two triples are similar.

This works ok, but my problem is this:

A valid submission should only happen when:
a. at least one checkbox is checked
b. the total sum of all number fields is in the range 3-30.

Note: I can’t simply force each number field to accept values in the range: 1-10, because user should be able to give up to 30 in one field and 0 on the other two.

I have used a computed_twig element and appropriate templates, and I have managed to put all my logic there and I show an appropriate message to the user. This works ok, so I have managed to print a green message when values are ok, and appropriate messages in red when values are invalid (if total sum is less than 3, or greater than 30 etc etc). I have covered all cases having enabled “Automatically update the computed value using Ajax” for the computed field, it updates on-the-fly and user has correct information on whether data is OK or NOT.

Now the problem and my question is:

I have been trying to hide the submit button, by selecting appropriate logic in the ‘conditions’ tab of the submit button. For example, something easy like “hide” or “disable” submit button, when pressure_total_thickness (computed twig value which holds the sum of individual number fields – same computed field which I successfully use for my messages) is greater than 30 ..

Problem is whatever I do there, the submit button is always present …

In a few words, what I want to do is validate data as much as I can in the front-end so that I don’t allow invalid submissions. I can do checks in the back-end (because data will subsequently be fed into another software) but it would be nice to do as much validation as possible in the front end and not allow submissions when data is invalid. Hence, use my computed_twig value which holds the sum of three number fields, and only show submit button when that value is between 3 – 30.

For example, here is the page with all three ‘triples’ – user has checked 2nd and 3rd checkboxes and supplied 15 and 30 values respectively. Total is 45, which is invalid and appropriate red message is written:

test case with invalid data

however, when user goes forward and reaches submit phase, the submit bitton is present although I use following condition to ‘hide’ it (have tried ‘disable’ in cindition, but same result – submit button was shown).

Here is the simple such condition for the submit button, trying to ‘hide’ it:

enter image description here

I tried to find documentation and/or previous questions/answers, but could not find anything relevant..

I must be doing something wrong, but I can’t find any way out of this ! ..

Webform is an amazing module, I am sure there is an easy way to achieve what I want. Any help would be appreciated!

Code for one of the three ‘triples’:

    '#type': checkbox
    '#title': 'Enable Insole'
    '#description': 'Please enable insole if you want to enter custom values below for material and layer thickness.'
    '#type': select
    '#title': 'Select Insole Material'
      1: Leather
      2: 'Composite leather & elastomer'
      3: EVA
      4: Polyisoprene
      5: 'Natural Rubber'
      6: Polychloroprene
      7: PTFE
      8: PU-Foam
          unchecked: true
    '#default_value': '0'
    '#type': number
    '#title': 'Insole Layer Thickness'
    '#help': 'See general help on choosing appropriate values for layers.&nbsp;Individual thickness for insole/midsole/outsole can have a range of 1-30 (mm), but total thickness of all layers&nbsp;&nbsp;combined cannot exceed 30 (mm).'
          unchecked: true
    '#default_value': '0'
    '#min': 0
    '#max': 30
    '#step': 1