I think you will need to write a custom widget, something like this :

def app_date_widget(field, value, placeholder='YYYY-MM-DD'):
    return DIV(INPUT(_name=field.name,
                 _id="%s_%s" % (field._tablename, field.name),
                 _class='%s %s' % (field.type, 'input-small'), #
input-small give the width to the field
                 _value=value,
                 _placeholder=T(placeholder),
                 requires=field.requires,
                 _autocomplete='off'),
                 SPAN(I(_class='icon-calendar', _style='cursor:pointer'),
_class='add-on'),
                 _class='input_wrapper input-append'
                 )

In my case I just activate bootstrap "input-small", create a wrapper for
the input field to make the html the way bootstrap require it, but I use
the web2py included datepicker, not the one you ask...

I also have a little js snippet into my html layout to make shure there is
not gap between the "input-small" and and the html input field...

You should read the book about custom widget for more information about it.

Richard


On Tue, Jun 18, 2013 at 11:36 AM, <[email protected]> wrote:

> Yes that is what I am talking about. I think I can use the js files to
> call it in my html possibly?
>
>
> On Tuesday, June 18, 2013 11:24:37 AM UTC-4, Richard wrote:
>
>> I guess you will have to build your own widget and pass the bootstrap
>> class... You are talking about this : http://tarruda.github.io/**
>> bootstrap-datetimepicker/<http://tarruda.github.io/bootstrap-datetimepicker/>
>>
>> ?
>>
>>
>> On Tue, Jun 18, 2013 at 7:51 AM, <[email protected]> wrote:
>>
>>> Very nice, thanks. Is there a way to use the bootstrap datetimepicker
>>> from here as well?
>>>
>>>
>>> On Tuesday, June 18, 2013 6:37:33 AM UTC-4, Niphlod wrote:
>>>>
>>>> you missed specifying the type. Right now that field is a "text" one
>>>> with a requires on it. Change that to
>>>> Field('date_of_birth', 'date')
>>>>
>>>> to get the datepicker automatically.
>>>>
>>>> Il giorno lunedì 17 giugno 2013 23:49:05 UTC+2, [email protected] ha
>>>> scritto:
>>>>>
>>>>> I am a bit confused on what I may be missing but how do I have a
>>>>> datepicker in my form?
>>>>>
>>>>> My db.py:
>>>>>
>>>>> b.define_table('patient',
>>>>>     Field('first_name', requires=IS_NOT_EMPTY()),
>>>>>     Field('last_name', requires=IS_NOT_EMPTY()),
>>>>>     Field('phone', requires=IS_NOT_EMPTY()),
>>>>>     Field('date_of_birth', required=IS_DATE(),
>>>>> requires=IS_NOT_EMPTY()))
>>>>>
>>>>> My Controller:
>>>>>
>>>>> def display_your_form():
>>>>>     form = SQLFORM(db.patient)
>>>>>     return dict(form=form)
>>>>>
>>>>> and my html:
>>>>>
>>>>> <center>
>>>>> <br /><br /><br />
>>>>> <h1>Web Form</h1>
>>>>> <br />
>>>>> <h2>Inputs:</h2>
>>>>> {{=form}}
>>>>> <h2>Submitted variables:</h2>
>>>>> {{=BEAUTIFY(request.vars)}}
>>>>> </center>
>>>>>
>>>>> Just doing this for example but was curious of there is more that I
>>>>> have to do to make this work so when a user selects date of birth the
>>>>> datepicker appears.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Tom
>>>>>
>>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to