Welcome Guest Search | Active Topics | Sign In | Register

Calendar how to add javascript to ClientSideOnClick Options
Christian Schweda
Posted: Friday, October 31, 2008 3:49:03 AM
Rank: Newbie
Groups: Member

Joined: 6/15/2007
Posts: 4
Hi,

sorry, I'm trying to add java script to Calendar.ClientSideOnClick.
I want to select a date for deleting files. Calendar ist a nested control in my menu. If end user clicks on a day a msgbox should appear ("Are you sure....") and only if he confirms the question, the page is posted back to run some server side code.
I try to use the ClientSideOnClick event but nothing happens.

Code: HTML/ASPX
<eo:CustomItem ID="mci1" runat="server">
  <eo:Calendar ID="cal1" runat="server" ControlSkinID="None" CssBlock="" CssFile="~/App_Themes/cx/cx.css" DayHeaderFormat="FirstLetter" DisabledDates="" DisableWeekendDays="True" SelectedDates="" TitleLeftArrowHoverImageUrl="00040205" TitleLeftArrowImageUrl="00040204" TitleRightArrowHoverImageUrl="00040207" TitleRightArrowImageUrl="00040206" VisibleDate="2008-09-01" Width="80px" AutoPostbackOnSelect="True" ClientSideOnSelect="MyCode()">
    <CalendarStyle CssClass="dtp1" />
    <DayHeaderStyle CssClass="dtp2" />
    <DayStyle CssClass="dtp3" />
    <DayHoverStyle CssClass="dtp5" />
    <TodayStyle CssClass="dtp5"/>
    <DisabledDayStyle CssClass="dtp6" />
    <OtherMonthDayStyle CssClass="dtp6" />
    <MonthStyle CssClass="dtp7" />
    <SelectedDayStyle CssClass="dtp8" />
    <TitleArrowStyle CssClass="dtp9" />
    <TitleStyle CssClass="dtp10" />
  </eo:Calendar>
</eo:CustomItem>


Thanks a lot
Christian Schweda
eo_support
Posted: Friday, October 31, 2008 5:45:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would do:

ClientSideOnSelect="MyCode"

Instead of:

ClientSideOnSelect="MyCode()"

Thanks
Christian Schweda
Posted: Tuesday, November 4, 2008 4:50:09 AM
Rank: Newbie
Groups: Member

Joined: 6/15/2007
Posts: 4
Hello,

thanks, this works with ClientSideOnChange event only.
How can I prevent a postback if end user doesn't confirm the question?

Regards
Christian Schweda
eo_support
Posted: Tuesday, November 4, 2008 5:53:25 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I do not think there is an easy way for you to prevent a post back with ClientSideOnSelect when AutoPostBackOnSelect is on. If you wish to do that, you will have to have AutoPostBackOnSelect set to false and then do postback in your script code if necessary.

All our client side JavaScript event takes the form of ClientSideOnXXX="function_name". Only the name of the function, not a call to the function is used.

Thanks
Christian Schweda
Posted: Wednesday, November 5, 2008 1:40:49 AM
Rank: Newbie
Groups: Member

Joined: 6/15/2007
Posts: 4
ok, thanks.
Now I have a solution with java script.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.