Home
The Toolkit for Online Communities
17226 Community Members, 0 members online, 1941 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Q&A : ad_form and dates : One Message

Forum OpenACS Q&A: Re: ad_form and dates

Collapse
4: Re: ad_form and dates (response to 3)
Posted by Tilmann Singer on
I don't know exactly how to do this in ad_form, but here's what works for me in a plain form builders if { [form is_request] } ... block:

db_1row ... { select to_char(start_date, 'YYYY-MM-DD') ... }

element set_value edit start_date [util::date acquire clock [clock scan $start_date]]

Maybe you can put that in an -on_request block of ad_form and modify it somehow so that it works?

Side note: I think the {reported_date ""} line should be removed - the form builder takes care of variables declared with it automatically. Otherwise you risk producing a "Move back and correct your error" message instead of the inline error message for that field.