1

I am sure that this will be my fault, as I can't believe that the RangeControlValidator is incorrect, but I can't see why this is not working.

 <ItemTemplate>
        <div class="reportItem">
        <div class="l1" >New</div>
        <div class="l2"><asp:Textbox runat="server" name="numberOnly" ID="tbNew" CssClass="compliance" onblur="calculateCompliance(this);"/>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required Value"  ControlToValidate="tbNew" Display="Dynamic" Text="*" />
            <asp:RangeValidator ID="RangeValidator3" runat="server" ErrorMessage="Must be a Positive Number" ControlToValidate="tbNew" Display="Dynamic" Text="*" MinimumValue="0" MaximumValue="1000" Type="Integer" />
        </div>

The Range validator is in a repeater. I am trying to limit the value in the text box to between 1 and 1000.

If I allow IE autocomplete to fill the box it works fine, but if I manually enter the value, then I get the red star and an Invalid result.

Initially I thought that this was because it was in a repeater, and it was getting confused over names, but the Required Field Validator works, so I no longer believe that this is the case.

So, can anyone see anything wrong with the code sample?, is somethign very odd going on?

(the onblur does nt affect the value in that cell, but it does read it to do a sum elsewhere)

4

0 回答 0