-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: PrakashSha
Message 13 in Discussion
Hi Prasanth,
If you want to do anything without a postback the best way is to do
using javascript. In one of my project i had this kind of scenario.
Where the user enters the date.(Startdate, enddate) startdate should
be <= endtdate , What i did was used softcomplex calendar..
Then used <Asp:customvalidator> for validating
If CDate(startDate.Value) > CDate(endDate.Value) Then
args.IsValid = False
End If
However, On click of the button only the value an error will be
displayed..You can add a javascript on form submit check whether the
value is greate <= and give an alert
<code>
<A
href="javascript:startDateCalendar.popup();"><IMG
height="16" alt="Click Here to Pick up the date"
src="../images/cal.gif" width="16"
border="0"></A>
<asp:CustomValidator
id="DateValidator" runat="server"
ControlToValidate="startDate" ErrorMessage="StartDate should be Less
than or Equal To End Date"></asp:CustomValidator></TD>
</TR>
<TR>
<TD style="HEIGHT:
21px"> End
Date : <INPUT id="endDate" readOnly type="text"
name="endDate" runat="server">
<A
href="javascript:endDateCalendar.popup();"><IMG height="16"
alt="Click Here to Pick up the date" src="../images/cal.gif"
width="16"
border="0"></A>
</TD>
</TR>
<TR>
</TR>
</TABLE>
/form>
<script language="javascript">
var startDateCalendar = new
calendar2(document.forms['Form1'].elements['startDate']);
startDateCalendar.year_scroll = true;
startDateCalendar.time_comp = false;
var endDateCalendar = new
calendar2(document.forms['Form1'].elements['endDate']);
endDateCalendar.year_scroll = true;
endDateCalendar.time_comp = false;
</script>
</code>
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]