Title: marklaramee's Replies | WordPress.org

---

# marklaramee

  [  ](https://wordpress.org/support/users/marklaramee/)

 *   [Profile](https://wordpress.org/support/users/marklaramee/)
 *   [Topics Started](https://wordpress.org/support/users/marklaramee/topics/)
 *   [Replies Created](https://wordpress.org/support/users/marklaramee/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/marklaramee/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/marklaramee/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/marklaramee/engagements/)
 *   [Favorites](https://wordpress.org/support/users/marklaramee/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Limit a post title to X characters] [Plugin: Limit a post title to X characters] Posts still publish even if title count is too long](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/)
 *  [marklaramee](https://wordpress.org/support/users/marklaramee/)
 * (@marklaramee)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/#post-2389183)
 * Hi
 * I did discover another issue: inthe JS, in your docReady function, you assign
   a keyup “verification_maximum” function to the title field. In this function,
   you make this assignment unCompteur = jQuery(elemId).val().length. This function
   works very well for the UI component on the right side.
 * The issue is…
 * That unCompteur value is used below on the submit click function: if(unCompteur
   <= maximum).
 * The problem is…
 * If the user comes to the edit page and does not modify the title (say they are
   just changing the category), when they click submit, they will get the error 
   that the title is too long (at least, in firefox they do). This happens because
   unCompteur has not been assigned and evaluates as “undefined” and causes the 
   if statement to render as false.
 * the fix is…
 * change the if statement in the submit click function as:
 * if(jQuery(‘#title’).val().length <= maximum)
 * Apologies if you fixed this already!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Limit a post title to X characters] [Plugin: Limit a post title to X characters] Posts still publish even if title count is too long](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/)
 *  [marklaramee](https://wordpress.org/support/users/marklaramee/)
 * (@marklaramee)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/#post-2389181)
 * Hi Jean-Philippe,
 * I’m glad that you found some of my code useful. re: the loading icon. Yes, I 
   can see your point. I guess the issue is that if we attach to the click event,
   we don’t intercept the “return” key. So, people can still submit the form, bypassing
   out character check.
 * It’s possible that the loading icon can be overridden via an hook in the PHP.
   I’ll let you know if I discover anything along those lines.
 * Thanks for the great plugin BTW. I really like the character counter on the right
   side. It’s excellent UI.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Limit a post title to X characters] [Plugin: Limit a post title to X characters] Posts still publish even if title count is too long](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/)
 *  [marklaramee](https://wordpress.org/support/users/marklaramee/)
 * (@marklaramee)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/#post-2389175)
 * Hi, another change in the “submitting even though under character count” post,
   
   change if(unCompteur < maximum) to if(unCompteur <= maximum)
 * for people not that familiar with the file structure, the JS file you need to
   change is here:
 * /wp-content/plugins/limit-a-post-title-to-x-characters/js/lptx-script.js
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Limit a post title to X characters] [Plugin: Limit a post title to X characters] Posts still publish even if title count is too long](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/)
 *  [marklaramee](https://wordpress.org/support/users/marklaramee/)
 * (@marklaramee)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/#post-2389174)
 * Also, the “settings” link in the plugins list was not working. It had the wrong
   URL. Change link near // Display a Settings link on the main Plugins page:
 * ‘options-general.php?page=limit-a-post-title-to-x-characters/lptx.php’
 * also, apologies if I am submitting this stuff incorrectly, I’m new to wordpress
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Limit a post title to X characters] [Plugin: Limit a post title to X characters] Posts still publish even if title count is too long](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/)
 *  [marklaramee](https://wordpress.org/support/users/marklaramee/)
 * (@marklaramee)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-limit-a-post-title-to-x-characters-posts-still-publish-even-if-title-count-is-too-long/#post-2389173)
 * I fixed the “submitting even though under character count” Go to the JS file 
   and attach the check to the submit of the form function, not the button press.
 * change the lines here: jQuery(‘#publish’).mousedown(function()
 * to this
 * jQuery(‘#post’).submit(function()
    { if(unCompteur < maximum) { return true; }
   else { alert(‘You are over the maximum allowed characters for the title!’); return
   false; } });

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