Javascript code not working
<p>The following code is not working. Want to check white spaces in an input field. If there are not any white spaces want to alert. Any help</p>

<pre><code>&lt;script language="javascript"&gt;
document.register.eventdtls.value;
function hasWhiteSpace(strg) {

var whiteSpaceExp=/\s+$/;

if (whiteSpaceExp.test(strg))
alert("Please Check Your Fields For Spaces");
      return false;
else
return true; 
}
&lt;/script&gt;
</code></pre>
