Can't set the all day event field to true on form load

rss

Posted by mcgaafar - Feb 23 ’16 at 04:45

Hi,

I'm trying to set the all day event checkbox on a new calender form to checked (True) on form load via javascript as follows:

fd.field('fAllDayEvent').value('1');

however it's not working.

Appreciate your help, and thanks in advance.

  • rostislav
    rostislav
    Moderator
    Member for: 7 years 7 months 3 days
    #1 by rostislav Feb 24 ’16 at 05:59

    Hi,

    Try this:

     fd.field('fAllDayEvent').control()._el().find('input').attr('checked', true);
  • mcgaafar
    Member
    Member for: 6 years 10 months 22 days
    #2 by mcgaafar Feb 24 ’16 at 04:24

    [#1]: Thanks for the reply, yes this made the all day event checkbox checked now, however the time controls for start time and end time of the event did not hide like the default behavior, so how can i get this to work?

    Thanks again.

     

  • rostislav
    rostislav
    Moderator
    Member for: 7 years 7 months 3 days
    #3 by rostislav Feb 25 ’16 at 06:00

    [#2]:

    Try this:

     fd.field('fAllDayEvent').control()._el().find('input').click();
  • mcgaafar
    Member
    Member for: 6 years 10 months 22 days
    #4 by mcgaafar Feb 26 ’16 at 11:30

    [#3]: Thanks a lot for your reply, it really helped, just to avoid an infinite loop of checking and unchecking the field, i had to place your code in IF condition, here's the code that worked for me:

    var allday = fd.field('fAllDayEvent').control()._el().find('input').is( ":checked" );
    if (allday == false){
    fd.field('fAllDayEvent').control()._el().find('input').click();
    }

  • williamtitu166
    Member
    Member for: 4 months 11 days
    #5 by williamtitu166 Aug 2 ’22 at 01:07

    I am new here.  I am a blogger and I come to your site to get amazingly knowledgeable and interesting information on your forum but I suggested to him that you can exchange his web hosting with zap hosting service using zap hosting code because your website is running slow when I have checked the blog that you have written for from his website. what is a great design of the website?

  • fhyiuui
    Member
    Member for: 3 months 15 days
    #6 by fhyiuui Aug 25 ’22 at 04:57

    Professional shooters will now join the battle for property here stick merge.

  • Finch012
    Member
    Member for: 1 month 23 days
    #7 by Finch012 Oct 14 ’22 at 11:53

    As i read the this question i cant stop me to answer this. i see so many question answers or discussion. the last discussion was snagit promo code. from that discussion i knew about snagit, how it work and what is the used for. i really greatful to be the part of this forum.

  • unthewizard
    Member
    Member for: 2 years 2 months 3 days
    #8 by unthewizard Oct 21 ’22 at 03:08

    The Sony HT-A9 is a versatile home theater system that can take your movie watching experience to the next level. The slim, sleek design allows for easy placement in any room, while the three-channel soundbar delivers powerful audio without taking up too much space. And with support for 4K and HDR content, you'll be able to fully immerse yourself in every scene. But the HT-A9's capabilities don't stop at just movies - it also has Bluetooth connectivity, allowing you to stream music wirelessly from your smartphone or tablet. Plus, with built-in Google Assistant, you can control the system using just your voice. Whether it's movie night with friends or a solo dance party in your living room, the Sony HT-A9 has got you covered.

Displaying 1 to 8 of 8 messages