Luminate Online- Events

Options
Hello, 


New to using LO for events. 


Does anyone have the problem that in the "additional gift" field is not limited to numerical figures, but can be filled in with letters? 
Tagged:

Comments

  • Yes to correct it I had to add some javascript :

    Y.use('jquery-noconflict', function() {

      const giftInput = jQuery("#gift_value");


      function handlers() {

        giftInput.blur(function() {

          let inputContent = jQuery(this);

          if ( inputContent.val() == 0 || isNaN( inputContent.val() ) ) {

            inputContent.val('0');

            inputContent.trigger("change");

          }

        });

      }


      jQuery(document).ready(function() {

        handlers();

      });


    });

    And this is just a tiny amount of all the javascript I had to add to have the event behave the way I wanted.

  • > And this is just a tiny amount of all the javascript I had to add to have the event behave the way I wanted.


    Welcome to working in Luminate! :)

    Y.use('jquery-noconflict', function() {

       const giftInput = jQuery("#gift_value");

       function handlers() {

         giftInput.blur(function() {

           let inputContent = jQuery(this);

           if ( inputContent.val() == 0 || isNaN( inputContent.val() ) ) {

             inputContent.val('0');

             inputContent.trigger("change");

           }

         });

       }

       jQuery(document).ready(function() { handlers(); });

     });



    Nice. Lookee them new fangled scoped variables with const and let. I gotta get in the habit of doing that.


    BPM


    EDIT: 'new fangled' = since 2015. Sigh.

     

Categories