Adding a “Please wait” message to long form submissions

I have a couple of forms on the company SharePoint Portal site that take a few seconds to submit. In the back end, they link into our financial packages, and rely on the external application to do some of the processing. As a result, it can take 10 seconds to return the results page. My problem i
s “How do I display a “Processing, please wait message” to the page?

Simple.

1) Set up your message, and style it with css.

<style> #processing{ position:absolute; width:150px; height:100px; top:50%; margin-top:-50px; left:50%; margin-left:-75px; padding:10px; font-weight:700; background-color:blue; color:white; display:none; ) </style>

The important thing in the style definition is “display:none;”. This stops the div from displaying initially.

<div id="processing"> please wait...<br /> <blink>Processing</blink> </div>

2) Add a bit of simple Javascript to the page

<script language="javascript"> function showstatus(){ processing.style.display = 'block'; } </script>

The javascript depends upon your div having an id of “processing”. If you want a different id for your div, please change the line “processing.style.display = ‘block';” accordingly.

nb. In SharePoint WebParts it is a little trickier to do. Add the div in a standard label, and the javascript can be output in the RenderWebPart method using output.Write(blah); It will probably work in the same label as the div, but I used the method above. easy to do, using the Page.RegisterClientScriptBlock() method.

3) Add an “onClick” handler to your button. The easiest way to do it is in the codeBehind.

buttonName.Attributes.Add("onClick","Javascript:showstatus()");

You can add that in your aspx file, if you are using one, but SharePoint WebParts don’t. :(

4) Build and deploy.

Easy when you know how.

MIT OpenCourseWare

A quick read on Tales from the Sharp Side this morning opened up a whole new range of learning possibilities to me. Scott was talking about how he could improve his computer science knowledge, and pointed the reader towards MIT OpenCourseWare

OCW describe themselves as follows…

a free and open educational resource for faculty, students, and self-learners around the world. OCW supports MIT’s mission to advance knowledge and education, and serve the world in the 21st century. It is true to MIT’s values of excellence, innovation, and leadership.

Sounds like somewhere I should visit,

Firefox NTLM Authentication

My esteemed colleague, Mr Dunbar, pointed me toward this entry regarding NTLM authentication in Firefox.

It’s a simple fix for an issue that have bugged us for month – how to get Firefox to pass the NTLM authentication token to a trusted website, and therefore negate the need to log in with your domain username / password.