Gossamer Forum
Home : Products : DBMan : Customization :

Autogenerate forms and default values

Quote Reply
Autogenerate forms and default values
I am using the autogenerate form option. When a users add's a record the userid field is default set. I want to store a user's email address (which is stored in $user_email) as the default value for a field. It tried to set this is in the default.cfg. But is not working. It tried to figure it out but i can't get it working

Quote Reply
Re: Autogenerate forms and default values In reply to
I could be misunderstanding your post, but you would not be able to have the default value come up as the field value for a new record, because the database would not be able to define that value for you.

The user would have to enter their email address.

Unless of course you have used a mod to have the email be what is used to login to your database in which case it would be stored in your .pass file.

Is this the case?



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Autogenerate forms and default values In reply to
Thanks for your reply Lois.

Yes you understood it very well.

I added

sub auth_check_password

chomp ($pass);
($userid, $pw, $view, $add, $del, $mod, $admin, $user_email) = split (/:/, $pass);

to the auth.pl to receive the e-mail address. It works. But i want to use this in the add form ( and use it as the default value) is doens't work. It don't understand this.

Greetings

Theo
ps. You have got a very nice page with a lot's of usefull information

Quote Reply
Re: Autogenerate forms and default values In reply to
Please check the FAQ again and look under the section for "Fields" for the topic:

Making email address appear in new entry

I'm not sure how this will work using autogenerate, but you may want to give it a try.

I think in the long run you may be much better off creating your own forms and not using autogenerate for your database.

Especially if you decide later to add mods or enhance your database further.

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/