Gossamer Forum
Home : Products : DBMan : Customization :

Auto Fill When Adding Another

Quote Reply
Auto Fill When Adding Another
I realize this has been covered as I have searched the forum with some success; I need to have a few of the fields automatically filled in after the first record is added by a user (to reduce redundancy for the user).

This page was recommended but I got a "not found" error:
http://www.gossamer-threads.com/scripts/forum/resources/Forum5/HTML/001592.html

Using cookies seems reasonable to me; but any guidance to a solution or previous discussion would be appreciated.

Thanks,

Jim

Quote Reply
Re: Auto Fill When Adding Another In reply to
In sub html_record_form, after

my (%rec) = @_;

add

Code:

if ($in{'add_form'}) {
$in{$db_cols[$auth_user_field]} = $db_userid;
my ($status2,@hits2) = &query("mod");
if ($status2 eq 'ok') {
%rec2 = &array_to_hash(0,@hits2);
# At this point, assign the fields that you want to autofill
$rec{'FieldName'} = $rec2{'FieldName'};
}
}


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Auto Fill When Adding Another In reply to
Hello!

Thanks for responding.

I put it in but it did not work; I used a URL field - it did eliminate bringing up the "http://" but did not bring in the info from previously added record.

if ($in{'add_form'}) {
$in{$db_cols[$auth_user_field]} = $db_userid;
my ($status2,@hits2) = &query("mod");
if ($status2 eq 'ok') {
%rec2 = &array_to_hash(0,@hits2);
# At this point, assign the fields that you want to autofill
$rec{'Company_Website'} = $rec2{'Company_Website'};
}
}

Thanks, Jim

Quote Reply
Re: Auto Fill When Adding Another In reply to
Actually, this worked perfectly in the non-sql version; But when I put in my SQL DBman all I got was blank fields returned - any thoughts?

Thanks,

Jim

Quote Reply
Re: Auto Fill When Adding Another In reply to
I'm sure glad you posted that last thing. I would have been trying to find where the error was.

I haven't had a chance to look closely at DBMan SQL. Sorry.


JPD
http://www.jpdeni.com/dbman/