The results are shown in image #2. As you can tell from the second set of code, we were trying different ways to reference the controls, but we could never seem to get the controls to visually update. In the first scenario, the "sender" variable is passed in, so is something going on under the hood that allows the updateCssClass() method to work ??? Is this possible outside of a change text event?

Vasil

In your code the "passwordCtl.value" is actually null every time so you don't invalidate the TextBox. You can use the get_value() of the client object to get the value.

Here is a working example:

<form id="form1" runat="server" onsubmit="return validateForm();">

<telerik:RadScriptManager runat="server">

</telerik:RadScriptManager>

<script type="text/javascript">

function validateForm()

{

var textBox = $find("<%=RadTextBox1.ClientID %>");

if (textBox.get_value() == "")

{

textBox._invalid = true;

textBox.updateCssClass();

return false;

}

}

</script>

<telerik:RadTextBox ID="RadTextBox1" runat="server">

</telerik:RadTextBox>

<asp:Button runat="server" Text="PostBack" />

I hope this helps.

Greetings,
Vasil
the Telerik team

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.