This is a migrated thread and some comments may be shown as answers.

RadInputManager Validation IsRequired white space

1 Answer 67 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 04 Aug 2010, 01:29 PM
Hi,

Can I make RadInputManager validation to triger also when user inputs space char as asp:RequiredFieldValidator does ?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 09 Aug 2010, 12:49 PM
Hello Jacob,

One possible option is to wire the OnValidating client-side event of the relevant setting and validate the value there:

<asp:ScriptManager runat="server">
</asp:ScriptManager>
<script type="text/javascript">
    function Validating(sender, args)
    {
        if (args.get_input().get_value() == " ")
        {
            args.set_isValid(false);
            args.set_cancel(true);
        }
    }
</script>
<telerik:RadInputManager runat="server" ID="RadInputManager1">
    <telerik:TextBoxSetting BehaviorID="TextBoxSetting1" Validation-IsRequired="true"
        ClientEvents-OnValidating="Validating">
        <TargetControls>
            <telerik:TargetInput ControlID="TextBox1" />
        </TargetControls>
    </telerik:TextBoxSetting>
</telerik:RadInputManager>
<asp:TextBox ID="TextBox1" runat="server">
</asp:TextBox>

I hope this helps

Regards,
Martin
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Input
Asked by
Jacob
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or