Gossamer Forum
Home : Products : DBMan : Customization :

Split Modification Forms (Partial modify)

Quote Reply
Split Modification Forms (Partial modify)
I'm working on some script changes so that a user can modify their record and modify their uploads seperate from each other. The only way that I was able to do this was to add hidden fields for all of the fields that would contain information, such as:

Code:
if ($rec{'field1'}) {print qq|<input type = "hidden"
name="$rec{'field1'} value="$rec{'field1'}>|;}

if ($rec{'field2'}) {print qq|<input type = "hidden"
name="$rec{'field2'} value="$rec{'field2'}>|;}
to the second modify page (the upload images section).

However, since I have over 80 fields in my database, this creates a lot of extra HTML to be sent back and forth to the browser, not to mention having to modify the database each time a user changed their uploaded images.

My question comes in two parts:

1. If I have to create the hidden fields for each field, is there an automated script that will create this? (for example, a loop that checks to see if an entry exists, and if it does, print the hidden form entry)

2. A way for the multiple upload MOD to ignore the values in the database. However, this doesn't seem to be really easy as when you're modifying the database, the values are entered into the forms already. If a value doesn't exist in the form, then it's removed from the database.

The way I have it set up, a user can only only upload images after they have already created a record. (They are limited to only adding one record so this is easy to do.) This also checks to make sure that the record already contains the required fields.

The script works as it stands now, but I'm trying decrease the amount of back and forth sending of information if I can prevent it.

Thanks for any ideas!
Dave W Schmid
The Music Shoppe

Because The Music Plays Forever...