advanced code snippet search
laxman2021 on 12/07/12
a TextField Trimming
12/07/12 07:19pm
Validating textbox using trim(), in javascript.
// trim functionfunction 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) }
Report this snippet Tweet
Comment:
You need to login to post a comment.