Gossamer Forum
Home : Products : DBMan : Installation :

Command so field can't be modified

Quote Reply
Command so field can't be modified
I feel guilty asking another question but I'll get to it. I inserted a mod so that users could add records but when they went to modify the record a certain field shows the text they enter but they can't modify it. All appears well and the field is blocked out but when you modify other parts of the record and hit the modify button an error message comes back saying that you can't leave the field blank. It appears to have text in it and it is a required field. Here is the code I put in.

Code

sub html_record_form {
# --------------------------------------------------------
# The form fields that will be displayed each time a record is
# edited (including searching). You don't want to put the
# <FORM> and </FORM tags, merely the <INPUT> tags for each field.
# The values to be displayed are in %rec and should be incorporated
# into your form. You can use &build_select_field, &build_checkbox_field
# and &build_radio_field to generate the respective input boxes. Text and
# Textarea inputs can be inserted as is. If you turn on form auto
# generation, the program will build the forms for you (all though they may
# not be as nice). See the README for more info.

my (%rec) = @_;
($db_auto_generate and print &build_html_record_form(%rec) and return);

print qq|
<div align="right">
<TABLE WIDTH="400" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="FFFFE1">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="100"><$font_color>(admin use only) ID:</FONT></TD>
<td valign="bottom"> <input type="hidden" name="ID" value="$rec{'ID'}" SIZE="20" MAXLENGTH="20"></TD></TR></td></tr>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Looking For:</FONT></TD>
<td valign="bottom"> |; unless ($modify_record) {
print &build_select_field("Looking_For","$rec{'Looking_For'}");
}
else {
print $rec{'Looking_For'};
}
print qq|</TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>(optional) Hours: </FONT></TD>
<td valign="bottom"> |; print &build_select_field ("Hours", "$rec{'Hours'}"); print qq|</TD></TR>

Does my question make sense......?

Quote Reply
Re: Command so field can't be modified In reply to
No need to feel guilty about asking another question. There's folks who have been asking questions regularly since before Christmas!! Smile

I must have forgotten something when I gave you the previous code. Sorry 'bout that.

Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Looking
For:</FONT></TD>
<td valign="bottom"> |;
unless ($modify_record) {
print &build_select_field("Looking_For","$rec{'Looking_For'}");
}
else {
print $rec{'Looking_For'};
print qq|<input type="hidden" name="Looking_For" value="$rec{'Looking_For'}">|;
}
print qq|</TD></TR>

Again, sorry if I forgot that before.


------------------
JPD





Quote Reply
Re: Command so field can't be modified In reply to
Wow thankyou! It works great. I am most impressed with the attention you give to the requests on here....!!! Absolutely superb my mentor!
Quote Reply
Re: Command so field can't be modified In reply to
No problem at all. I'm one heckuva gal!! Wink

And not the least vain!!!!!!



------------------
JPD