Gossamer Forum
Home : Products : DBMan : Installation :

In Modify: won't return all fields

Quote Reply
In Modify: won't return all fields
When I select a record to modify, the form automatically enters some *but not all* of the original field values.

I don't know if this may be relevant, but I have 42 fields total, and I'm using "short display to long display".

I've copied my default.cfg, default.db, and html.pl to a readable directory: http://www.schoolshows.com/

Thanks for looking at this.

Rick
Quote Reply
Re: In Modify: won't return all fields In reply to
This just in...

I discovered that the field values that won't be returned are those that I've specified to be put in a TEXTAREA. When I specify the INPUT TYPE="text" everything is fine.

Hmmm? Is there any way to keep TEXTAREA input in my form?

Rick
Quote Reply
Re: In Modify: won't return all fields In reply to
You'll need to rename the files so that they have a .txt extension. I tried to access your html.pl file and the server tried to execute it instead of displaying it.

My thought is that your textarea tags are not correct. The format for a textarea is different than the format for a text field.

You need to use

<TEXTAREA NAME="FieldName" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'FieldName'}</TEXTAREA>



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





Quote Reply
Re: In Modify: won't return all fields In reply to
Yes! Problem solved!

But, I'm still not getting my select fields.

In html_record_form I have:

Category: |; print &build_select_field ("category", "$rec{'category'}");
print qq|

I'm guessing this is not correct. Can you enlighten me?

Thanks again.

Rick

Quote Reply
Re: In Modify: won't return all fields In reply to
Your select field syntax seems correct, so long as your field is named "category" and not "Category." (Remember that field names are case-senstive.)

There are two other possible reasons that your select fields don't show up correctly on the modify form. One is if you have spaces before or after the commas in the list of options in your select field definition in the .cfg file.

Right:
Category => 'Option1,Option2,Option3'

Wrong:
Category => 'Option1, Option2, Option3'

The other reason is that you don't have your options all on one line. Be sure you keep all the options on the same line for each select field.

If neither one of these things fit, copy your .cfg file to a web-accessible directory and rename it with a .txt extension -- default_cfg.txt would work -- and I'll take a look at it. I'm almost positive it's something in the .cfg file.

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





Quote Reply
Re: In Modify: won't return all fields In reply to
I'll give it a try and let you know.

Thanks,
Rick
Quote Reply
Re: In Modify: won't return all fields In reply to
I've renamed default.cfg, and you can find it at: http://www.schoolshows.com/public_html/default_cfg.txt

While you're there, look at my select fields and radio fields. I get neither returned on my Modify form.

Thanks for taking the time to look.

Rick
Quote Reply
Re: In Modify: won't return all fields In reply to
Try setting

$db_auto_generate = 1;

in your default.cfg file and see what happens. If your modify works then, you'll know the problem is in your form definition. If it doesn't work, you'll know the problem is in your .cfg file.

I don't see the problem right off, but this may help.


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





Quote Reply
Re: In Modify: won't return all fields In reply to
Tried this and it doesn't work, so it must be in cfg.

Rick
Quote Reply
Re: In Modify: won't return all fields In reply to
I did a little extra snooping and found that I could directly access your .db file from the browser. (If you want to be sure your info is secure, you may need to make some changes.)

What I noticed was that every field of every record in your database starts with a space. You'll need to take those out. Perl is very literal. " Anti-racism" is not the same as "Anti-racism."

I'm not sure why those spaces are there, unless you created the database by hand. DBMan strips out leading and trailing spaces before it adds the record to the database.


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





Quote Reply
Re: In Modify: won't return all fields In reply to
Yes, you are right again. Indeed, I was trying to build the database by hand (in an attempt to convert an old database).

In addition to taking out the spaces, I also had to delete the quotation marks. Which leads to the question: is there anyway to keep double quotation marks in, without converting them to single quotation marks?

Thanks, again!
Rick
Quote Reply
Re: In Modify: won't return all fields In reply to
I don't know that I've ever had to deal with quotation marks in the database before.

Since you already took them out, though, try modifying a record where you want quotations marks and add them back in. See what happens.

You're welcome. Smile

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





Quote Reply
Re: In Modify: won't return all fields In reply to
I tried putting back the quotes through the Modify form, but it's a no go. I can live with this. I'll just use single quotes.

Thanks for all your nurturance! I'm cruising now!
Rick
----------------------
And just a BTW -- I also wanted to use MULTIPLE select fields, so I perused the forum and found your reply of March 15 to AriadnaDB on "how to use multiple select fields" . I think (even though I don't presume to know a tenth of what you do about programming) that there was an error in the line:

&build_select_field("fieldname","$rec{'fieldname'},"fieldname","MULTIPLE",3)

Shouldn't it have a " after {'fieldname'} ?
Quote Reply
Re: In Modify: won't return all fields In reply to
Good catch! Yep. I make that kind of mistake all the time. My brain works faster than my fingers.


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