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: 13119
  • 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 Saturday, 20 September 2014

Get Help Today

Send an email here!

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

Web Hosting

Web Hosting here!

25% Coupon Code:

couponSolWeb25OFF

Get Sol News

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