CODE – TSQL returns true if the string is a valid email address.

Change Layout

HOW-TO Remove tool bar from webpart

SharePoint 2007

Step by Step – How to remove the tool bar from a webpart 

Open Sharepoint Designer, Add your webpart zone, Add your webpart

When you hover over your webpart in the view pain of the SharePoint Designer there will be a spreadsheet icon to click.

Navigate down to Change Layout

Change Layout

The List View Options window will appear, you can then uncheck the Show toolbar with options for:, or you can change the tool bar to Summary toolbar

List view options

HOW-TO change the default value of a empty webpart

SharePoint 2007

Step by Step – Change the default value for a empty WebPart

When I create a new webpart that has an empty list the default value looks alot like this “To create a new item, click “New” or “Upload” above.” or “There are no items to show in the view of the ‘NAME OF DOCUMENT LIBRARY’. To create a new item, click ‘New’ or ‘Upload’ above. ”  However in my scenario I have removed the menu bar.  So I need to change this note.

NOTE: With a standard webpart this option is grayed out. So you will need to convert your webpart to a XSLT Data View.

1.Right click on your webpart in the view pane, and click “Convert to XSLT Data View…”

2.From the Data View menu on your task bar select “Data View Properties…”

3.On the General Tab you will see a check box “Display text if no matching items are found:”

4.Change text and click OK.

CODE – PowerShell audit exchange servers and create html output

Audit a list of Exchange servers and create a HTML code

This script will audit a list of Exchange servers, you can supply by either piping servers to the script (from commands like get-transportserver) or specifying a list of servers in a text file. If the script does not detect any input it will use get-exchange server to find servers to test. The script writes an HTML report file which can be opened using any browser.

CODE – Javascript Function right

Simple JavaScript function Right(string,number)

CODE – Javascript Function create, store and delete a cookie

In this example we will create a cookie that stores the name of a visitor. The first time a visitor arrives to the web page, he or she will be asked to fill in her/his name. The name is then stored in a cookie. The next time the visitor arrives at the same page, he or she will get welcome message.

First, we create a function that stores the name of the visitor in a cookie variable:

The parameters of the function above hold the name of the cookie, the value of the cookie, and the number of days until the cookie expires.

In the function above we first convert the number of days to a valid date, then we add the number of days until the cookie should expire. After that we store the cookie name, cookie value and the expiration date in the document.cookie object.

Then, we create another function that checks if the cookie has been set:

The function above first checks if a cookie is stored at all in the document.cookie object. If the document.cookie object holds some cookies, then check to see if our specific cookie is stored. If our cookie is found, then return the value, if not – return an empty string.

Last, we create the function that displays a welcome message if the cookie is set, and if the cookie is not set it will display a prompt box, asking for the name of the user:

How to Delete a cookie.

CODE – JavaScript Function isNumeric() function

A simple isNumeric function for JavaScript that allows scientific notations. You could always modify the RegExp to be /^(-)?(\d*)(\.?)(\d*)$/ for simple numbers like -123.00

CODE – Javascript Function add option to a select box

How to add the single select option to the selection list with the id specified