Gossamer Forum
Home : Products : DBMan : Customization :

Get it to work

Quote Reply
Get it to work
hi,Could anyone help me to get the following to work after i turn off the auto generated form function (set to 0 ) :
1.Pulls the email address from the password file when a user adds a new record
2.Allows selection of "admin-only" checkboxes, radio fields, select fields and textareas
3.Creates "clickable" links for email addresses and URLs
4.Allows you to set whether you would like skip rows in the record display if the field value is blank.
5.Maintains line formatting in textarea fields


I would be very appreicated!!

Quote Reply
Re: Get it to work In reply to
1) If you have the Secure Password Lookup Mod installed, you should've seen the following codes written in the Mod instructions that will allow you to do this....

Code:
if ($in{'add_form'}) {
$rec{'Email'} = &get_email;
}
<HR></BLOCKQUOTE>

(Of course, you will have to change Email to the name of your Email field.)

2) Use the following codes in the sub html_record_form routine in the html.pl file:

(BTW: This has been discussed numerous times in this Forum...Please try using the Find in Page option in your browser in the Forum's home page or use the search form.)

Code:
if ($per_admin) {
print qq|<TD><$font>Field Name</font></TD>
<TD>|; print &build_select_field("FieldName", "$rec{'FieldName'}"); print qq|</TD>
|;
}
else {
print qq|<TD><$font>Field Name</font></TD>
<TD>|; <input type="hidden" name="FieldName" value="$rec{'FieldName'}"></TD>
|;
}
print qq|

Change FieldName to the name of your fields (select fields, radio fields, checkboxes, etc.).

3) Use the following codes in the sub html_record routine:

Code:
if ($rec{'URL'}) {
print qq|<a href="$rec{'URL'}">$rec{'URL'}</a>
|;
}
else {
print qq|No URL|;
}

AND

Code:
if ($rec{'Email'}) {
print qq|<a href="mailto:$rec{'Email'}">$rec{'Email'}</a>|;
}
else {
print qq|No Email Address|;
}

4) Use the following codes in the sub html_record routine:

Code:
if ($rec{'FieldName'}) {
print qq|<TD><$font>Field Name</font></TD>
<TD>$rec{'FieldName'}</TD>
|;
}
else {
print qq| |;
}

Change FieldName to the name of your field.

5) Use the following codes after the my (%rec) = @_; codes in the sub html_record routine:

Code:
foreach $column (@db_cols) {
$rec{$column} =~ s/\n\n/<P>/g;
$rec{$column} =~ s/\n/<BR>/g;
}

HOPE THIS HELPS!

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Get it to work In reply to
Thanks a lot,Eliot!!

I have benn playing around it but still no clues....Now,i got it!!

THanks !
Quote Reply
Re: Get it to work In reply to
Good.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Get it to work In reply to
something problem here...if i use the code u wrote it to me alone like the following :

if ($rec{'Email'}) { print qq|<a href="mailto:$rec{'Email'}">$rec{'Email'}</a>|;}else { print qq|No Email Address|;}

That works fine..but after i added the following code :

<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Email:</FONT></TD>if ($rec{'Email'}) { print qq|
<TD><$font><a href="mailto:$rec{'Email'}">$rec{'Email'}</a></Font></TD>|;}else { print qq| <TD></TD>|;} </TR>

Error message come out..Could you please help me to fix it??
Thanks a lot!

Quote Reply
Re: Get it to work In reply to
Uh...you totally screwed up the codes I suggested before (BTW: I would HIGHLY recommend you learn more about Perl and HTML...they will assist you in debugging perl scripts and using them!).

Change the following codes:

Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Email:</FONT></TD>if ($rec{'Email'}) { print qq|
<TD><$font><a href="mailto:$rec{'Email'}">$rec{'Email'}</a></Font></TD>|;}else { print qq| <TD></TD>|;} </TR>

to the following:

Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Email:</FONT></TD>
|;
if ($rec{'Email'}) {
print qq|<TD><$font><a href="mailto:$rec{'Email'}">$rec{'Email'}</a></Font></TD>|;
}
else {
print qq|<TD></TD>|;
}
print qq|
</TR>

Best of luck!

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums