On Monday, April 16, 2018 at 1:52:54 AM UTC-7, tomasz bandura wrote:
>
> Hello,
>
> I need to do some action after selecting value in datetime field.
> After my investigation it looks the one way is to create  my own datetime 
> component with implemented 'onSelect' event.
>
> Another option  is to use another datetime (jquery) control.
>
> I'd like to avoid it but i have no an idea how to add an event listener to 
> datetime control on a page.
>
> Has anyone already met such an issue?
>
> Tomasz 
>

Not a direct answer, because this doesn't use a datetime widget (IssueYr is 
an integer for this usage), but I have lines like the following in my view 
file:

   jQuery('#QM_IssueYr').blur(function(){
       if (jQuery('#QM_IssueYr').val() < 1999) {
           /* alert("trying to go to Mint"); */
           jQuery('#QM_Mint').focus();

where the references are to form fields. I used blur()  because that seemed 
to do the best job of capturing "leaving the field", but you may want to 
handle a different event.  The element reference was obtained by doing an 
"inspect element" on a "dumb" view, but there is a anming convention in 
use, and I expect FORM follows it even as SQLFORM does.

/dps


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to