Changes to Required Field ‘title’ Attribute in SharePoint?!??!?

Client Side Devs!!  I’ve got to help spread the word about this. Microsoft has decided to change the way the “title” attribute field is rendered for required fields in SharePoint.

So instead of referencing a the “Title” field using jQuery like:

$(input[title=’Title’]”)

If “Title” is a required field you must now reference this field like:

$(input[title=’Title Required Field’]”)

Personally, I think it’s a bad decision to change something that’s been ingrained since SharePoint 2007, and thousands of developers have embraced.

This “feature” was first reported in Office 365, but there are reports of it cropping up in SharePoint 2010 after applying the latest updates.

Developers, please be aware of this change and modify your scripts accordingly!!!

For those of you looking for a quick fix

You can place the following few lines of script as the first line in your document.ready function. This script finds all those required fields and strips out the “ Required Field” text so that your old scripts should function properly. Is it a hack?? ABSOLUTELY! Will it get your scripts working again? yes sir/ma’am… It should at least give you some relief until you can come up with a better plan.  Good luck to you!

$(document).ready(function() {    
    $("[title$=' Required Field']").each(function()
    {
        $(this).attr("title",$(this).attr("title").replace(" Required Field",""));
    });
});

Again, I’m not saying you should put this script in place and forget about it. I’m saying, you can put this script in place to get your broken forms working again and give you some breathing room to go and refactor as needed.

For more information about this “feature” introduced to SharePoint, and to check out a great discussion about the topic check out Marc Anderson’s blog where I first found out about this:

http://sympmarc.com/2014/01/23/office-365-update-changes-display-name-on-required-fields/

Families in Germany who are facing divers soundness problem, such persons can buy drugs from the Web without prescription. With the market flooded with divers web-sites selling sundry medicaments, purchasing medicines from th WEB is no longer a trouble for common man. Certain medications are used to treat infections caused by dental abscesses. Of course it isn’t all. If you’re concerned about erectile heartiness problem, you probably know about Xenical and Hoodia. Probably each adult knows about Garcinia. (Read more PhentermineXenical). The symptoms of sexual health problems in men include improbability to have an erection sufficient for sexual functioning. Certain medications may add to sex drive difficulties, so its substantial to cooperate with your soundness care professional so that the prescription can be tailored to your needs. Preparatory to grab Levitra or other preparation, speak to your pharmacist if you have any allergies. Talk to your health care producer for more details. Preparatory to ordering this remedy, tell your doc if you are allergic to anything.

2 Comments

  1. Mark:

    As you and I have discussed, I worry about people implementing hacks like this unless they commit to putting in real fixes ASAP. You said that in your post, but I wanted to reiterate it.

    I’ve got what I think is a rock solid fix for this in the latest alpha of SPServices 2014.01. It works for Office365 (SharePoint Online) / SharePoint 2013. I want to also try to get a fix in for SharePoint 2010. If anyone out there sees the issue in SharePoint 2010 (with or without the December 2013 CU), I’d love to take a look at the markup you’re seeing.

    M.

Comments are closed.