• $(document).ready(function () {
      //called when key is pressed in textbox
      $("#quantity").keypress(function (e) {
         //if the letter is not digit then display error and don't type anything
    
         var agetdata = $(this).attr("maxlength");
          limit_check($(this),  agetdata);
         if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
            //display error message
            $("#errmsg").html("Numbers Only").show().fadeOut("slow");
                   return false;
        }
       });
         function limit_check(limit_id,  num) {
                    var txt_cnt = limit_id.val();
                    txt_cnt = txt_cnt.substring(0, num);
                }
    });

    Can anyone tell me why my code isn’t saving?

    https://www.ads-software.com/plugins/css-javascript-toolbox/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Violutus

    (@violutus)

    <script type="text/javascript">
    jQuery(function($) {
      //called when key is pressed in textbox
      $("#quantity").keypress(function (e) {
         //if the letter is not digit then display error and don't type anything
    
         var agetdata = $(this).attr("maxlength");
          limit_check($(this),  agetdata);
         if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
            //display error message
            $("#errmsg").html("Digits Only").show().fadeOut("slow");
                   return false;
        }
       });
         function limit_check(limit_id,  num) {
                    var txt_cnt = limit_id.val();
                    txt_cnt = txt_cnt.substring(0, num);
                }
    });
    </script>

    Code updated to what I think should work, but still doesn’t save.

    Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hi Violutus,

    Thanks for your support message.
    We are currently inundated with other development work and projects. When we get more free time, we will look into these issues and further feature development.

    Many thanks in advance for your understanding.

    Kind Regards,
    Damian

    Hello,

    How it doesn’t save?

    Will the Block still empty after refreshing the page?

    Please explain.

    Regards,
    AHMeD

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘jquery code block won't save’ is closed to new replies.