Hi,
Client-Side Validation example (Note: Trim function contained within 'Javascript_functions.js' file.)
<script type='text/javascript' src='Javascript_functions.js'></script>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
/////////////////////////////////////////////////////////////
// This function is used to validate data on the
// client before it is submitted to the server to ensure
// columns that do not allow nulls do not get submitted to server
//////////////////////////////////////////////////////////////
function thisPage_onbeforeserverevent( obj, event ){
if (obj=="btsave"

{
if(event=="onclick"

// Note: There is no javascript Trim function...
// See Javascript_functions.js included above
{ // Check if something entered for Site Name
if(Trim(document.thisForm.txtsitename.value) == ""

{
alert("Site Name cannot be blank!"

;
// Cancel the update.
thisPage.cancelEvent = true;
document.thisForm.txtsitename.focus();
}
if(document.thisForm.lbcompanyid.value == ""

{
alert("Company cannot be blank!"

;
// Cancel the update.
thisPage.cancelEvent = true;
document.thisForm.lbcompanyid.focus();
}
// Check if something entered for Region
if(Trim(document.thisForm.txtregion.value) == ""

{
alert("Region cannot be blank!"

;
// Cancel the update.
thisPage.cancelEvent = true;
document.thisForm.txtregion.focus();
}
// Check if something entered for Area
if(Trim(document.thisForm.txtarea.value) == ""

{
alert("Area cannot be blank!"

;
// Cancel the update.
thisPage.cancelEvent = true;
document.thisForm.txtarea.focus();
}
// Check if something entered for UTC Offset
if(Trim(document.thisForm.txtutcoffsetmin.value) == ""

{
alert("UTC offset cannot be blank!"

;
// Cancel the update.
thisPage.cancelEvent = true;
document.thisForm.txtutcoffsetmin.focus();
}
}
}
}
//-->;
-----------------------------
Note: Trim functions within 'Javascript_functions.js' supplied by // Trim, LTrim, Rtrim JavaScript Functions Written by:
// Scott Mitchell
// mitchell@4guysfromrolla.com
//
------------------------------------------------
Computergeek