If you're using the AnyTime date/time picker (which currently comes with
web2py), then your <input> element must have a unique 'id' attribute (even
though web2py doesn't use the 'id' to attach AnyTime). This is mentioned
near the bottom of http://www.ama3.com/anytime/, in the "Behavior Issues"
section.
Also, note that AnyTime has just been removed from web2py because it turns
out its license is not compatible with the web2py license. You cannot use
AnyTime for free in a commercial website (that charges users) or in a
website for which the developer was paid. We have reverted to the old
calendar.js -- I'm not sure if that requires the <input> field to have a
unique id.
Anthony
On Saturday, November 26, 2011 6:17:01 PM UTC-5, Roger Baker wrote:
>
> Hello,
>
> I know I am probably overlooking something really obvious, but I can't
> get the datepicker to show up for a simple search field. The search
> seems to work ok, but I have to manually enter the date.
>
> my controller function is:
> ***********************************************************************
> def search():
> form=FORM(INPUT(_name='datestamp', _class='date',
> requires=IS_DATE()), INPUT(_type='submit'))
> if form.accepts(request.vars, session):
> entry =
> db(db.log_entry.datestamp==form.vars.datestamp).select().first()
> if entry:
> session.flash='Found it!'
> redirect(URL('edit', args = entry.id))
> else:
> response.flash="Can't seem to find it..."
> elif form.errors:
> response.flash='there was a problem...'
> else:
> response.flash='Enter something!'
> return dict(form=form)
>
> ************************************************************************
>
> my view is just:
>
> {{extend 'layout.html'}}
> <h1>This is the default/search.html template</h1>
> {{=form}}
>
> I know it is probably an obvious noob mistake, but I just don't see
> it...
>
> Thanks
>
>