Return to Snippet

Revision: 61362
at December 7, 2012 19:19 by laxman2021


Initial Code
//  trim function
function trim(str)
{
	return str.replace(/^\s*|\s*$/g,"");
}
// 	end trim 



if (trim(document.frmPremises.txtpremisescontactname.value) == '')
 {
 alert("Enter Contact Name.");
 document.frmPremises.txtpremisescontactname.focus();
 return(false)
 }

Initial URL

                                

Initial Description
Validating textbox using trim(), in javascript.

Initial Title
Validating textfield name for spaces using javascript.

Initial Tags

                                

Initial Language
PHP