Trim Function
Function: trim
Input : ' Test Trim Function ', ''
Output: 'Test Trim Function'
Example:
trim(document.getElementById(varUB).value, '')
function trim(str, chars) {
return ltrim(rtrim(str, chars), chars);
}
function ltrim(str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function rtrim(str, chars) {
chars = chars || "\\s";
return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
Change Button Mouse Hover Pointer
Input: Button control client id
Example:
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnMouseOver="onMouseOver(this);" OnMouseOut="onMouseOut(this);" />
function onMouseOver(btnCntl) {
btnCntl.style.cursor = 'hand';
}
function onMouseOut(btnCntl1) {
btnCntl1.style.cursor = 'default';
}