On Thursday, September 27, 2018 at 5:28:50 AM UTC-7, Rahul wrote: > > Hey All, > This is essential - I can do what Donald has said but I want to > do it at runtime. It would also be helpful when I try to implement say for > example select a country from drop down and then populate states as per the > country selected in another dropdown. may more use cases like that > including calculations like age by selecting date fro date widget and > populating years based on selected date in another field. I think these use > cases are pretty valid and have seen them in a lot of web apps (typically > aspx, php and java/jsp). How I achieve it in web2py with SQL forms or CRUD > forms is what I am looking for. > > Regards, > Rahul >
The basic answer is AJAX, and jQuery provide AJAX tools. There is also support in web2py for some simple direct ajax operations. I would urge you not to use the CRUD forms; they are deprecated and not being maintained. In the documentation at the tip of the tree, you will find a warning about this. (There seem to be some hosting issues with getting the tip version displayed.) /dps > On Thursday, September 27, 2018 at 2:24:04 AM UTC+5:30, Dave S wrote: >> >> >> >> On Wednesday, September 26, 2018 at 10:43:31 AM UTC-7, Donald McClymont >> wrote: >>> >>> Hi Rahul >>> >>> You could just do this with Jquery as events that run when any of the 3 >>> fields are exited however I am not convinced that's really a great approach >>> - I haven't seen an example of doing this as part of the actual SQLFORM. >>> Another question would be do you really need to concatenate them as part of >>> your data entry? If you need them later you could use a >>> computed/calculated field or some function to concatenate them when >>> required? >>> >>> Regards >>> Donald >>> >>> >> I haven't done the concatenation part [1], but I've done the lost focus >> thing as a way to walk through the proper fields of an SQLFORM where which >> fields apply depend on the value of the first field. This has worked >> pretty well, except for some oddities ... like deciding to click a sidebar >> [or breadcrumb] link instead of finishing the form, or wanting to correct a >> single field. >> >> /dps >> >> >>> >>> >>> On Tuesday, September 25, 2018 at 1:57:32 PM UTC+1, Rahul wrote: >>>> >>>> Hi Everyone, >>>> Is it possible to have lost focus events in web2py SQLForms >>>> or CRUD ? By lost focus I mean building the Full name automatically from >>>> First, Middle and Last Name provided while filling the form and display it >>>> in Full name filled upon lost focus of either field.. Can we do it ... how >>>> ? >>>> >>>> Rahul >>>> >>> -- 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.