Sol Web Solutions Blog

Sol Web Solutions Blog is aimed to help, inform, educate and enable our site visitors.

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Login
    Login Login form

jQuery on List NewForm is disabling Attach File in ribbon

Posted by on in SharePoint
  • Font size: Larger Smaller
  • Hits: 34255
  • 0 Comments
  • Subscribe to this entry
  • Print

Some custom jQuery to autopopulate a text field via localStorage was used in a Content Editor on our NewForm.aspx page for a SharePoint 2010 list:

<script src="/.../jquery.js" type="text/j-avascript"></script>

<script type="text/j-avascript">
window.on-load = function(){
                window.setTimeout(readyCall, 1000);
}
function readyCall(){
     var piddata = localStorage.getItem('myPID');
$("#ctl00_m...TextField").focus();
$("#ctl00_m..._TextField").val(piddata);
}</script>

It's working as expected and auto-populating our field, but the top ribbon (especially the Attach File) in the ribbon was disabled.

The ribbon was finally enabled by using:

<script type="text/j-avascript">
$(document).ready(function()
{
   var e = $("input[id$='ctl00_m_g_..._TextField']");
   var piddata = localStorage.getItem('myPID');   
   e.val(piddata);   
});
</script>

0

Comments

  • No comments made yet. Be the first to submit a comment

Leave your comment

Guest
Guest Thursday, 28 March 2024

YOU ARE AWESOME!
I'm so blessed to
have people like you who
continue to make this
operation go.

Love the website.

Thanks for your hard work.

...thanks! I will pass it on to
our amazing web master
at Sol Web Solutions.

I LOVE the photos
on your web site.

It's really exciting to see the
site come together.
THANKS!!!

Get Started!

Help Today

Send an email here!

Sol Web Solutions will be glad to help you anytime with general or technical questions, suggestions or comments.

Website Hosting

Web Hosting

Sol News

We will not share, trade, or sell any of your information in any way. Your privacy is completely respected.