Title: jquery code block won&#039;t save
Last modified: August 22, 2016

---

# jquery code block won't save

 *  [Violutus](https://wordpress.org/support/users/violutus/)
 * (@violutus)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-code-block-wont-save/)
 *     ```
       $(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://wordpress.org/plugins/css-javascript-toolbox/](https://wordpress.org/plugins/css-javascript-toolbox/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Violutus](https://wordpress.org/support/users/violutus/)
 * (@violutus)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-code-block-wont-save/#post-5648955)
 *     ```
       <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](https://wordpress.org/support/users/wipeoutmedia/)
 * (@wipeoutmedia)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-code-block-wont-save/#post-5649026)
 * 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
 *  [Code Machine](https://wordpress.org/support/users/xpointer/)
 * (@xpointer)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-code-block-wont-save/#post-5649046)
 * 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.

 * ![](https://ps.w.org/css-javascript-toolbox/assets/icon-256x256.gif?rev=3132209)
 * [CSS & JavaScript Toolbox](https://wordpress.org/plugins/css-javascript-toolbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/css-javascript-toolbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/css-javascript-toolbox/)
 * [Active Topics](https://wordpress.org/support/plugin/css-javascript-toolbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/css-javascript-toolbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/css-javascript-toolbox/reviews/)

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * 3 replies
 * 3 participants
 * Last reply from: [Code Machine](https://wordpress.org/support/users/xpointer/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/jquery-code-block-wont-save/#post-5649046)
 * Status: not resolved