Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problem with onChange event

Guest
May 04, 2008 May 04, 2008
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
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , May 06, 2008 May 06, 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

Translate
Enthusiast ,
May 06, 2008 May 06, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 09, 2008 May 09, 2008
LATEST
Hi Ken,

Many thanks for your reply.

Best regards,
Yogesh
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources