troubleshooting Question

validation control used for check box and radio button

Avatar of tanaya80
tanaya80 asked on
JavaScriptASP.NETWeb Applications
2 Comments1 Solution699 ViewsLast Modified:
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>
ASKER CERTIFIED SOLUTION
tanaya80

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros