[web2py] Re: Generate input from db field...

2010-06-25 Thread Yarko Tymciurak
On Jun 25, 3:50 am, Andrew Buchan wrote: > Yarko, > > I tried doing this with a DIV, but if I put the whole form within the DIV, I meant submitting the first form, and doing a LOAD() in another part of the page conditionally, based on some submit value of the first form (instead of directing to a

Re: [web2py] Re: Generate input from db field...

2010-06-25 Thread Andrew Buchan
Yarko, I tried doing this with a DIV, but if I put the whole form within the DIV, that doesn't seem to work. If you mean just putting the input fields in the DIV, with the submit button outside of that, then that's what my original question was about: how to generate a table with labels/inputs by

[web2py] Re: Generate input from db field...

2010-06-25 Thread Yarko Tymciurak
On Jun 25, 3:24 am, Andrew Buchan wrote: > Sorry for delay in getting back. I eventually opted for a solution which > does not involve JQuery, instead a department-specific list of fields is > passed to SQLForm, which makes things so much simpler. > The only draw back is that the user has to selec

Re: [web2py] Re: Generate input from db field...

2010-06-25 Thread Andrew Buchan
Sorry for delay in getting back. I eventually opted for a solution which does not involve JQuery, instead a department-specific list of fields is passed to SQLForm, which makes things so much simpler. The only draw back is that the user has to select a department on one page, and is then redirected

[web2py] Re: Generate input from db field...

2010-06-22 Thread Yarko Tymciurak
You need to think about this --- On Jun 22, 11:15 am, mdipierro wrote: > This is no longer a client issue. I think you do handle the problem > correctly client side. > The problem is that if some fields exist in db but you do not want to > insert them you need to change the validator from > > db.

[web2py] Re: Generate input from db field...

2010-06-22 Thread mdipierro
This is no longer a client issue. I think you do handle the problem correctly client side. The problem is that if some fields exist in db but you do not want to insert them you need to change the validator from db.table.field.requires=blabla() into db.table.field.requires=IS_EMPTY_OR(blabla())

Re: [web2py] Re: Generate input from db field...

2010-06-22 Thread Andrew Buchan
Hi Massimo, I posted the code below before checking if the form would actually submit. What now happens is that all the fields are put through validation, including those which I hid with JQuery, and needless to say, most of them fail because they're empty! There's no way I can do away with the v

Re: [web2py] Re: Generate input from db field...

2010-06-22 Thread Andrew Buchan
Massimo, Thanks for that, I was about to reply saying that JQuery can't do what I want it to, then thought I'd test my statement before making it. Here's the code for anyone who's interested: Its all in the controller, as I pretty much use only one single multi-purpose view for all my pages :-)

[web2py] Re: Generate input from db field...

2010-06-21 Thread mdipierro
This is what I would do - make a single for that contains all fields you need - use jQuery in the view so that depending on the selected department some fields are hidden On Jun 21, 3:38 am, Andrew Buchan wrote: > Hello, > > I am trying to make a form for inserting a new record representing an