Gossamer Forum
Quote Reply
Help
I get an error when trying to modify my record that says UserID (Can not be left blank) However when i view the source
the user id is being passed as a hidden field so I dont know why I am getting this error. So at this point no one can modify their records. HELP Smile

------------------
Visit the coolest Cat Links site
on the net!
http://www.crayzee.com/tonks/links/index.html
Quote Reply
Re: Help In reply to
Not that field. I'm talking about the field in sub html_record_form.

Are you using autogenerate?


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





Quote Reply
Re: Help In reply to
not sure if i am using autogenerate. But there is no user id field in the html_record_form that I saw. All I saw was it being passed as hidden. I looked at the original code too and didnt see a userid field in the html_record_form. Am I missing something?
Quote Reply
Re: Help In reply to
ok NOT using autogenerate, although is there an advantage to doing so. And here is the code in 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);

my $font = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#000000';

print qq|
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFFF">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font>ID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="ID" VALUE="$rec{'ID'}" SIZE="3" MAXLENGTH="3"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Name:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Name" VALUE="$rec{'Name'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Email:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Email" VALUE="$rec{'Email'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Location: </FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Location" VALUE="$rec{'Location'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Age Group: </FONT></TD>
<TD VALIGN="TOP"> |; print &build_select_field ("Age", "$rec{'Age'}"); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>WebSite:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="WebSite" VALUE="$rec{'WebSite'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Date:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Date" VALUE="$rec{'Date'}" SIZE="12" MAXLENGTH="12"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Gender:</FONT></TD>
<TD VALIGN="TOP"> |; print &build_select_field ("Gender", "$rec{'Gender'}"); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Interests:</FONT></TD>
<TD VALIGN="TOP"> <TEXTAREA NAME="Interests" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Interests'}</TEXTARE$
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Favorite Verse(s):</FONT></TD>
<TD VALIGN="TOP"> <TEXTAREA NAME="Verse" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Verse'}</TEXTAREA></TD>$

</TABLE>
|;
}


Nowhere in the code does it ask for the userid yet it gives me an error that it must not be blank...
Quote Reply
Re: Help In reply to
Are you sure that your fieldname is spelled correctly in both NAME="FieldName" and VALUE="$rec{'FieldName'}". From what you said, I would look to the NAME part of your hidden field to make sure that it matches the field name exactly.

If that doesn't work, I may have to have access to your database to be able to figure it out.

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





Quote Reply
Re: Help In reply to
Its the same code that came with the script i changed NOTHING.
<input type=hidden name="uid" value="$db_uid">
This is how it is all through the script and it even gets past correctly. I didnt modify it.
Quote Reply
Re: Help In reply to
You'll have to add the field in.

Right after

print qq|

add

<input type="hidden" name="UserID" value="$rec{'UserID'}">

If your user id field is not named UserID, make the appropriate changes. Make sure that in both places it is spelled the same as in your .cfg file and has the same case. "UserID" is not the same as "Userid" or "UserId."



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





Quote Reply
Re: Help In reply to
thanks, that worked, i must have deleted that line at some point without realizing it. Smile