Avatar of tanaya80
tanaya80
 asked on

validation control used for check box and radio button

Hi,
i am using a two textboxes for start date and end date.There is a checkbox is also present.If the user will not select the checkbox the validation control for textbox1,will happen.If the user will checked the checkbox then for second validation condition will be applied for the second textbox will happen.I am able to check the condition in server side, but i am looking that when the user will checked the checkbox then the validation control will be activated, if not checked the validation control will not be activated , in the client side.So all the thins will happen in client side.I am attaching the code snippet for the more understanding.For not sending the page to validate in the server side , i am looking for the thing is to be done in the client side, second thing i am using 2 textbox , and 2 dropdown to submit a form.I have a save and reset btn.I want that when user will click  the reset btn the values of the textbox, and dropdown will be rest in the clinent side.So looking for best solution with examples..

Happy programming....
~cheers
Tanaya
<tr>
        <td style="width: 25%">
            <asp:Label ID="lblStartDate" runat="server" CssClass="Labelnormal" Text="Begin running the schedule on:" Width="235px"></asp:Label>
        </td>
        <td>
            <rad:raddatepicker ID="rdpStartDate" runat="server">
              <datepopupbutton hoverimageurl="~/RadControls/Calendar/Skins/Web20/Img/datePickerPopupHover.gif"
               imageurl="~/RadControls/Calendar/Skins/Web20/Img/datePickerPopup.gif">
              </datepopupbutton>
 <rad:raddatepicker ID="rdpEndDate"  runat="server" >
              <datepopupbutton hoverimageurl="~/RadControls/Calendar/Skins/Web20/Img/datePickerPopupHover.gif"
               imageurl="~/RadControls/Calendar/Skins/Web20/Img/datePickerPopup.gif">
              </datepopupbutton>
              <DateInput Width="70px" style="font-size: 11px;">
              </DateInput>
              <Calendar Skin="Web20">
              </Calendar>
            </rad:raddatepicker>
            <asp:CompareValidator ID="cfvDate" runat="server" Enabled="false" ControlToCompare="rdpStartDate" ControlToValidate="rdpEndDate" Display="Dynamic" ErrorMessage="End Date cannot be less than Start Date" Text="*" Operator="GreaterThanEqual" Type="Date" ValidationGroup="TaskDetails" ></asp:CompareValidator>
            <asp:RequiredFieldValidator ID="rfvrdpED" runat="server" Enabled="false" ValidationGroup="TaskDetails" ControlToValidate="rdpEndDate" Display="Dynamic" ErrorMessage="Please select valid End Date" Text="*" InitialValue=""></asp:RequiredFieldValidator>
        </td>
 
this is in the page design code, and in .cs page i have used code like 
 Protected Sub chkStopSchedule_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkStopSchedule.CheckedChanged
            If chkStopSchedule.Checked Then
                cfvDate.Enabled = True
                rfvrdpED.Enabled = True
            Else
                cfvDate.Enabled = False
                rfvrdpED.Enabled = False
            End If
        End Sub
              <DateInput Width="70px" style="font-size: 11px;">
              </DateInput>
              <Calendar Skin="Web20">
              </Calendar>
            </rad:raddatepicker>
            <asp:RequiredFieldValidator ID="rfvrdpSD" runat="server" ValidationGroup="TaskDetails" ControlToValidate="rdpStartDate" Display="Dynamic" Text="*" ErrorMessage="Please select valid Start Date" InitialValue=""></asp:RequiredFieldValidator>
        </td>
    </tr>

Open in new window

ASP.NETJavaScriptWeb Applications

Avatar of undefined
Last Comment
tanaya80

8/22/2022 - Mon
alfie77

ASKER CERTIFIED SOLUTION
tanaya80

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck