Gossamer Forum
Home : Products : DBMan : Customization :

Combined Preview Mod, Relational & Short/Long Display Problem

Quote Reply
Combined Preview Mod, Relational & Short/Long Display Problem
I am using the preview mod with the relationship database which allows a short/long display for the admin and for a registered user it goes directly to their user information when they click on Modify User Info in the footer. I have installed the Preview Mod so that users (as well as the admin) is able to preview the User Information before it is added to the database. Everything seems to be working except the preview page. A display of the users information is previewed at the top portion of the page but in the bottom half of the page which should have the user form completed with the users information the fields are empty. I changed &html_record(%in); to &html_record_long(%in); thinking that this would help but it doesn't.

Can anyone please help me figure this out?

Here is the preview portion of code from my html.pl file:

sub html_preview {
# --------------------------------------------------------
&html_print_headers;

print qq|
<html>
<head>
<title>$html_title: Record Preview.</title>
</head>
<body bgcolor="#DDDDDD">
<center>
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Record Preview</b>
<br>
<p><center><$font_title><b>Record Preview</b></font></center><br>
<$font><P><Font face="Verdana, Arial, Helvetica" Size=2>
This is your record as you entered it.
If you are satisfied with it, use the "Add it!" button directly
below the record.
Otherwise, make the changes in the form and use the "Preview
Record" button below the form.:</FONT>
|;
&html_record_long(%in);
print qq|
<form action="$db_script_url" method="POST" name="form1">
<center><INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add It!"><HR></center>
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
|;
&html_record_form(%in);
print qq|
<p><center>
<INPUT TYPE="SUBMIT" NAME="preview_record" VALUE="Preview Record">
<INPUT TYPE="RESET" VALUE="Reset Form"></center></p></form>
|;
&html_footer;
print qq|
<br>
</body>
</html>
|;
}



Thanks in advance!
Cher
Quote Reply
Re: [chronisca] Combined Preview Mod, Relational & Short/Long Display Problem In reply to
I don't see from what you provided way this is not working?

I did notice that the only section that differs from the mod instructions is:


<form action="$db_script_url" method="POST" name="form1">
<center><INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add It!"><HR></center>
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">

rather than:

<center> <FORM ACTION="$db_script_url" METHOD="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add It!"></center><P>

I'm not sure if having the submit button before the db is defined would make a difference, but you never know :)


This is the sub I was using in one of my databases, you might want to try it and see if it works for you:

sub html_preview {
# --------------------------------------------------------
$page_title = "Preview Ad";
&html_page_top;

print qq|
<P><center><$font_title><b>Preview Ad</b></font></center><P>
<$font>This is how your record will appear in the database<BR>If you are satisfied with it, use the \"Add it!\" button directly below the record.<P>
Otherwise, make the changes in the form and use the \"Add Record\" button below the form.<P>If you decide to not add your record, choose reset and return to $html_title.</font><P>
|;
&html_record(%in);
print qq|
<center> <FORM ACTION="$db_script_url" METHOD="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid"></center><P>
$line<P>|;
&html_record_form (%in);
print qq|<P><center><INPUT TYPE="SUBMIT" NAME="preview_record" VALUE="Preview Again"> &nbsp; &nbsp; <INPUT TYPE="SUBMIT" NAME="add_record" VALUE="Add It!"></center></FORM></td></tr>
</table></center><P>|;

&html_footer;
&html_page_bottom;


This was using the short long mod, so you will need to adjust for your page settings.

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Combined Preview Mod, Relational & Short/Long Display Problem In reply to
Thanks a lot Lois! I'll try it and let you know the outcome.
Cher