[web2py] Re: Form field manipulation questions

2017-04-06 Thread Dave S


On Monday, January 9, 2017 at 11:47:05 PM UTC-8, Dave S wrote:
>
> Now I'm trying to use 
> jQuery("fieldx").blur(function {jQuery("fieldy").focus()}); 
> to control which field in the form the user goes to after completing 
> fieldx.  This works great unless I try to set a blur function on fieldy; it 
> thinks fieldy is blurring as soon as I set focus on it.  Annoying, to say 
> the least.  (Testing in Chrome, so far)
>
> Suggestions?
>
>
I seem to have solved this by, in the fieldy copy of this,   replacing 
blur() with focusout().  I've only changed the one field so far, but I will 
probably do the other(s) as well.

/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.


[web2py] Re: Form field manipulation questions

2017-01-09 Thread Dave S
Now I'm trying to use 
jQuery("fieldx").blur(function {jQuery("fieldy").focus()}); 
to control which field in the form the user goes to after completing 
fieldx.  This works great unless I try to set a blur function on fieldy; it 
thinks fieldy is blurring as soon as I set focus on it.  Annoying, to say 
the least.  (Testing in Chrome, so far)

Suggestions?

/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.


[web2py] Re: Form field manipulation questions

2017-01-09 Thread Dave S


On Tuesday, January 3, 2017 at 1:35:51 AM UTC-8, Dave S wrote:
>
> I have an SQLFORM where I wanted the value of field 3 to depend on the 
> value of field 2, sort of like cascading autocompletes, but not quite. 
>  Field 3 was going to be populated with the length of the string in Field 
> 2, so I tried adding to my view
>
> 
> jQuery(document).ready(function(){
>jQuery(''#QM_Len__label'').click(function(){jQuery('#QM_Len__label').
> val(jQuery("#QM_Mint__label").length)});
> });
> 
>
> This didn't seem to do anything.  Obviously I wasn't completely 
> understanding the autocomplete example in Chapter 11, nor other posts in 
> this forum.  What was I missing?  Also, I should be able to use 
> jQuery.focus() in place of jQuery.click(), yes?
>

Ah, I found that I needed to strip the "__label" ; I had drilled in 
not-carefully-enough when using inspect-element in the browser.


> Note:  For this specific issue, I have found that making Field 3 a 
> computed field in my qm-db.py definitions works quite well, but I think I 
> may run into other situations where having the answer to this will make 
> those easier to handle.
>
> [There's a second question, but I think I can handle it by defining a 
> custom validator.  I may want to have equivalent validation on the browser 
> side, though, so I may be back with Q2 later.]
>
>
And this one was covered by "IS_MATCH", because the input was to be 
arbitrary combinations of 'x', 'd', and 'p' used as a string.
 

> Thanks.
>
> /dps
>

For the record.
 

-- 
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.