Sunday, May 30, 2010

Javascript Tips - 2

To trim a word using Javascript, use the following:
var field1 = document.formname.textbox.value.replace(/^\s+\s+$/g, "");

No comments: