3

This question is an exact duplicate of:

Surely, as a newbie here at SE, I have missed something.

The title will display "Title cannot be longer than 150 characters" if it is too long, but no indication of the actual length.

My usual approach is to create in a word processor and then copy/paste.

If my title is too long, I will edit in the title box, removing unessential words, until it is the correct length, but see no display to help here at SE.

I suppose I could check the length of the title in my word processor, but am I missing something?

The body box lets me know how many characters are left, that's what I am looking for here...

Enter image description here Enter image description here

SEE ANSWER BELOW: enter image description here

marked as duplicate by random, Robert Longson, hat, ale, Rob Dec 27 '18 at 16:57

This question was marked as an exact duplicate of an existing question.

4

No, there is not.

You have to rely on a userscript to do so. For that to work, install a userscript manager in your browser (I use TamperMonkey) and then add the following script to it:

// ==UserScript==
// @name         show chars left in a title
// @namespace    https://meta.stackexchange.com/users/158100/rene
// @version      0.1
// @description  add chars left / used on a title
// @author       rene
// @match        *://*.stackexchange.com/questions/ask
// @match        *://stackoverflow.com/questions/ask
// @match        *://superuser.com/questions/ask
// @match        *://servefault.com/questions/ask
// @match        *://stackapps.com/questions/ask
// @match        *://mathoverflow.net/questions/ask
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // where is the title
    var targetNode = document.getElementById('title');

    // we observe changes, like adding the validation message to the DOM
    var observer = new MutationObserver(function(elems, sender) {
        var i, elem, splitmsg;
        // lets see what we got
        for( i = 0; i < elems.length; i = i + 1) {
            elem = elems[i];
            // we're only in for the validation message
            if (elem.type === 'childList' &&
                elem.target &&
                elem.target.classList &&
                elem.target.classList.contains('js-stacks-validation-message') && // the most important check
                (elem.target.textContent||'').indexOf('Your title is') === -1 // let's not keep adding our own stuff
               ) {
                // let's keep the first part
                splitmsg = (elem.target.textContent || '.').split('.');
                // add the title length at the end
                elem.target.textContent = splitmsg[0] +
                    '. Your title is ' +
                    targetNode.value.length  +
                    ' characters';
            }
        }
    });

    // we're not interested in attribute changes
    var config = { attributes:false, childList: true, subtree: true };
    if (targetNode) {
        observer.observe(targetNode.parentElement.parentElement, config);
    }

})();

Find its source on GitHub and Direct Install

This is what it will look like when the script is in action:

error message extended with number of characters in the title

  • It would seem this Script should be built in, apparently the Duplicate of my question was created 5 years ago. I am used to this feature on other sites I use including WordPress - a very professional editing platform. How can I turn this Duplicate into a Request for change here, I am new and don't know all the "ropes" yet. I will install the Script until the feature is added. – P Lloyd Dec 27 '18 at 22:34
  • @PLloyd the request for change (called feature requests here) already exists here. You can upvote it to show your support and if you have enough reputation you could put a bounty on it but be advised that Stack Exchange Inc. sets their own priorities and for the core Q/A engine those priorities seem low. I won't have high hopes this will be implemented anytime soon. It might take 6 to 8 weeks – rene Dec 28 '18 at 9:54
  • the userscript works fine, I find it difficult to understand why this simple change needs voting, or bountry to get installed. Anyone using Wordpress or any similar system is used to and expecting this, but maybe there is Too much democracy here....thx, I will be reminded of this post every time I enter a too long post and it tells me by how much! – P Lloyd Jan 7 at 4:05
  • @PLloyd the difference being that Wordpress is mainly open source and as such can have many contributors to add new features. Stack Exchange on the other hand has opted for a closed source model with (based on the .Net stack) where only Stack Exchange staff can add new features. That makes having the democratic voting system the next best thing to signal which features the community feels are useful to have. And that still doesn't guarantee the most voted feature will get implemented in 6 to 8 weeks ... – rene Jan 7 at 11:39

Not the answer you're looking for? Browse other questions tagged .