Date field (Textbox w/ Calendar) JavaScript event firing
Last Post 08-20-2013 01:32 PM by Tony. 7 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
TonyUser is Offline
going with the flow
going with the flow
Posts:45
Avatar

--
08-16-2013 11:49 AM

    I'm trying to setup a date field where the customer enters it and then I ultimately want to calculate how many days it has been from that date in the past to today.  I started by adding a javascript event that copies the date field to another text field.

    $(Dupe) = $(MyDate);

    I'm not seeing the contents getting copied after choosing the date using the calendar or typing it in.  I there another way to accomplish this behavior?

    Thanks,
    Tony Green

    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    08-16-2013 12:15 PM
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    08-16-2013 12:26 PM
    That's great for the date arithmetic stuff but I'm still having trouble with the event firing:

    I'm not seeing the contents getting copied after choosing the date using the calendar or typing it in. I there another way to accomplish this behavior?

    Tony
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    08-16-2013 01:20 PM
    I'm not sure I understand what you mean by "the contents are not getting copied." Do you mean the dates are not populating correctly after you use the date picker?

    If so, can you please tell me what field type you're using? Is it a textbox or a date field?

    Please visit www.datasprings.com/formdemos and check out Demo 28. Does it behave differently if you try any of the other date options here?

    Thanks!
    Candace


    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    08-16-2013 02:25 PM
    Sorry I hope the following is clearer.

    I have a date field (Textbox w/ Calendar) named MyDate and a text field named Dupe. I put the following JS code into the MyDate JS Client Side Event:

    $(Dupe) = $(MyDate);

    I get nothing displayed in the Dupe field when I tab out of the MyDate field after entering a valid date. Also, I get no output in Dupe if I use the Calendar control either but the MyDate textbox portion does update.

    Tony
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    08-17-2013 01:42 PM
    I have more information on the problem. It appears that the Date field code $(MyDate) does not correctly decode to the appropriate javascript Element ID value as shown below:

    onblur="document.getElementById('dnn_ctr496_DynamicForms_TBR_GUIDdef3b897-92f9-4fd1-acea-e7007de9ff93Dupe').value = document.getElementById('dnn_ctr496_DynamicForms_').value; ;"

    Note the missing GUID and the short name of the field near the end of the code. So, how does one access the date field value from javascript?

    Thanks,
    Tony
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    08-20-2013 07:32 AM
    Hi,
    Does anyone have more information on this problem. Am I missing something or is this a real bug in the product?

    Thanks,
    Tony
    TonyUser is Offline
    going with the flow
    going with the flow
    Posts:45
    Avatar

    --
    08-20-2013 01:32 PM
    I finally found an obscure reference to the fact that you have to get the date value by using the HTML id of the text box. However, this still does not help with the scenario of selecting a date with the Calendar. No onblur event is fired when using the Calendar so I'm still not able to automatically do any processing with the date. Is there a better way?


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi