Friday, July 27, 2012

Modals and Javascript Tip - Forcing Textbox Value Update

I had an interesting challenge surface in attempting to reference a textbox wrapped in a modal div. Interestingly, the text box wouldn't update it's own value attribute. I couldn't conclusively determine the exact cause of this issue, other than it only occurred, so long as the textbox box was encapsulated within the the modal div. To resolve this, I created a simple function within the modal to force the texbox value to populate into the value attribute. Presto!


<input type="text" id="addressBox" onblur="javascript: fixValue(this.value);" />
        <script type="text/javascript">
        function fixValue(fixThis)
        {
        fixThat = document.getElementById('addressBox');
        fixThat.value = fixThis;
     
        }
        </script>

Wednesday, July 25, 2012

SharePoint 2010 Tip - Hiding Save Button on Edit Ribbon

This took me a little time to compose, having encountered some difficulties finding a suitable answer in forums. My goal was to block a user's ability to use the "Save" and "Cancel buttons on the Edit ribbon.
The reason being, is that I wanted to control customized behaviors when a form was submitted. This Save button bypasses custom actions. I isolated the span id containing the Save and Cancel buttons, then created a similar Master page including the following code:

function nullSaveBtn()
{
document.getElementById('Ribbon.ListForm.Edit.Commit-LargeLarge').style.display='none';
}
The function, is of course called from the onload handler. The result is quite satisfying.

Tuesday, July 24, 2012

TMCAcademy Design Unveiling

Moving along with TMCAcademy.com! The new site is not linked to a domain (Sorry, no viewing on the web yet), but I do have a teaser snapshot attached! (Click for a larger, far more interesting, version)

Tuesday, July 3, 2012

TMCAcademy Site

My next project is set to help redesign and essentially modernize TMCAcademy.com! Be excited with us all as we dive into this process!