Hello,
I have table with a "subject" field, with default value specified in model.
Now I would like to generate forms to add and update records.
In the forms the default value specified in the model has to be
overriden on certain conditions.
I tried these:
form.vars.subject = "another default value"
form.custom.dspval.subject = "another default value"
form.custom.inpval.subject = "another default value"
But none of them works, still there are model default values filled in
the form fields.
Please, could you help?
Thanks in advance..
David
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpOSuIACgkQ3oCkkciamVGjGACeNxJre32E0Kg60BDZCSC3LG1E
gL0An2cy1fws0OaHvhaIkBrnNN5WgYSZ
=zZus
-----END PGP SIGNATURE-----
Please, do you have any advices?
David Zejda napsal(a):
> Hello,
>
> I have table with a "subject" field, with default value specified in model.
>
> Now I would like to generate forms to add and update records.
> In the forms the default value specified in the model has to be
> overriden on certain conditions.
>
> I tried these:
>
> form.vars.subject = "another default value"
>
> form.custom.dspval.subject = "another default value"
>
> form.custom.inpval.subject = "another default value"
>
> But none of them works, still there are model default values pre-filled in
> the form fields.
>
> Please, could you help?
>
> Thanks in advance..
>
> David
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpXPrEACgkQ3oCkkciamVGzkACgo5qrBcRjdXm975QkirF85B9F
qOAAoIaIojQTG4Jfx2bhdet7Hx0VzQMz
=02Cn
-----END PGP SIGNATURE-----
Oh sorry, I just overlooked the initial reply.. :o)
Hans Donner napsal(a):
> David, 10 minutes after your original post there was already a reply:
>
> http://groups.google.com/group/web2py/browse_thread/thread/de36120b9337f00d/1fde78aa5827a84c?hl=en&lnk=gst&q=override+default+model+values+in+SQLFORM#1fde78aa5827a84c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpk5YEACgkQ3oCkkciamVFtJwCdE1ARh9teph1nzhtN70gdKWXU
sNQAoJ3lEgXwgGCidr4wpnAmKleyc3UA
=DlnB
-----END PGP SIGNATURE-----