Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Submit failure - category drop-down list instead of fixed field?

Quote Reply
Submit failure - category drop-down list instead of fixed field?
Hi,

I've search for answers to this one, and experimented myself to no avail. When you add a site and there is an error in the submission, the site_html_add_failure page is displayed.

The page itself displays fine, but the category turns into a drop-down list with nothing selected. I would like it to be fixed and just display the category as it does on the submit page.

Here's the relevant sections from my site_html.pl file:

Quote:
sub site_html_add_failure {
# --------------------------------------------------------
# This routine determines how the add failure page will look like. You have
# access to the following variables:
#
# $errormsg : A bulleted list of the problems.
# %in : variables used in adding the form. Useful for recreating
# the form
#

if ($category) {
($category =
qq~$category<input type=hidden name="Category" value="$category">~);
}
else {
if (!@exclude_categories) {
($category = &build_select_field ("Category"));
}
else {
($category = &get_cat_select_list);
}
}

my ($errormsg) = $_[0];

&html_print_headers;
{ print qq~
<html>
<head>
... etc ...

<font face=arial size=+3 color="#800040">
<strong>Submission Error</strong>
<font face=arial size=2 color="#000000">
<br><br>

<form action="$build_add_url" method="POST">

<p>There were the following errors trying to add your details:</p>
<p><strong>
<font color=red>$errormsg</font>
</strong></p>
<p>Your details have <b>not been submitted</b> because of the reported error above.</p>
<p>Please go BACK to the previous page, make any necessary changes to your submission details, and try again!</p>

<table border ="0" cellspacing="0" cellpadding="3">
<tr><td height=22 align="right" valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">Site Title:</td>
<td height=22 valign="absmiddle"><FONT SIZE=3 COLOR="#000000" FACE="VERDANA,ARIAL"><input name="Title" value="$in{'Title'}" size="30"></td></tr>
<tr><td height=22 align="right" valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">Site URL:</td>
<td height=22 valign="absmiddle"><FONT SIZE=3 COLOR="#000000" FACE="VERDANA,ARIAL"><input name="URL" value="$in{'URL'}" size="30"></td></tr>
<tr><td height=22 align="right" valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">Category:</td>
<td height=22 valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">$category</td></tr>
<tr><td height=22 align="right" valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">Short Description:</td>
<td height=22 valign="absmiddle"><FONT SIZE=3 COLOR="#000000" FACE="VERDANA,ARIAL"><textarea wrap="virtual" name="Description" value="$in{'Description'}" rows="2" cols="32">$in{'Description'}</textarea></td></tr>
<tr><td height=22 align="right" valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">Keywords:</td>
<td height=22 valign="absmiddle"><FONT SIZE=3 COLOR="#000000" FACE="VERDANA,ARIAL"><input name="Keywords" value="$in{'Keywords'}" size="30" MAXLENGTH="50"></td></tr>
<tr><td height=22 align="right" valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">Contact Name:</td>
<td height=22 valign="absmiddle"><FONT SIZE=3 COLOR="#000000" FACE="VERDANA,ARIAL"><input name="Contact Name" value="$in{'Contact Name'}" size="30"></td></tr>
<tr><td height=22 align="right" valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL">Contact Email:</td>
<td height=22 valign="absmiddle"><FONT SIZE=3 COLOR="#000000" FACE="VERDANA,ARIAL"><input name="Contact Email" value="$in{'Contact Email'}" size="30"></td></tr>
<tr><td height=22 valign="absmiddle"></td><td height=22 valign="absmiddle"><FONT SIZE=2 COLOR="#000000" FACE="VERDANA,ARIAL"><input type="SUBMIT" name="add_record" value="Add Resource"></td></tr>
</table>
</form>
<br>

Anyone know the answer to this one?

All the best
Shaun

------------------
Shaun Hague
Webmaster - Qango.com
http://www.qango.com/central/
Quote Reply
Re: Submit failure - category drop-down list instead of fixed field? In reply to
Try changing the following codes:

Code:
if ($category) {
($category =
qq~$category<input type=hidden name="Category" value="$category">~);
}

to the following:

Code:
$category ?
($category = qq~$clean_category <input type=hidden name="Category" value
="$category">~) :
($category = &build_select_field ("Category", "$in{'Category'}"));

Regards,

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Submit failure - category drop-down list instead of fixed field? In reply to
Eliot,

Using a variation of your code I managed to get the result I wanted - thanks for your advice.

All the best
Shaun

------------------
Shaun Hague
Webmaster - Qango.com
http://www.qango.com/central/
Quote Reply
Re: Submit failure - category drop-down list instead of fixed field? In reply to
Good.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------