Skip to main content
May 5, 2008
Answered

Problem with onChange event

  • May 5, 2008
  • 1 reply
  • 1165 views
Hi,

I'm currently experiencing a problem with the onChange event when using an input type datefield.
e.g.
<cfinput type="datefield" name="date_txt" width="175" mask="dd/mm/yyyy" onFocus="date_txt.disabledDays = [0,6];" tabindex="1" style="text-align:left" onChange="checkDate();">

And then when I alert the date selected in function checkDate, I still get the old figure.
e.g.
public function checkDate():Void{
alert("Date selected: "+date_txt.text);
}

E.g. if the original date displayed is 05/05/2008 and I select another date (02/05/2008), then when the alert box appears, it still shows 05/05/2008.

Any idea on how to solve this issue?

Is it a bug with Flash forms?

Thanks and regards,
Yogesh Mahadnac
    This topic has been closed for replies.
    Correct answer The_ScareCrow
    I would assume that the onchange function happens before the text value is actually set.
    Use the correct value
    alert("Date selected: " + date_txt.selectedDate);

    Ken

    1 reply

    The_ScareCrowCorrect answer
    Inspiring
    May 6, 2008
    I would assume that the onchange function happens before the text value is actually set.
    Use the correct value
    alert("Date selected: " + date_txt.selectedDate);

    Ken

    May 9, 2008
    Hi Ken,

    Many thanks for your reply.

    Best regards,
    Yogesh