Gossamer Forum
Home : Products : DBMan : Customization :

Problem with Validation Mod

Quote Reply
Problem with Validation Mod
Hello there. I downloaded and installed the validation mod that was listed below: http://www.jpdeni.com/...n/Mods/validate1.txt

I got everything working but the validation part doesn't seem to be working. When you add new records it still shows up on the search feature and when I click on the validate button when I log in with the admin feature, it give me an unknown action error.

Any ideas? You can see the database at www.canoesforcamps.com/cgi-bin/camps/db.cgi

Thanks for your help.
Remember, Elvis dies on the throne...
Quote Reply
Re: [akasharkbow] Problem with Validation Mod In reply to
Make sure you followed the instructions and added all the necessary changes.

Especially in your db.cgi sub main

make sure you have the following lines:

elsif ($in{'validate_form'}) { if ($per_admin) { &html_validate_form; } else { &html_unauth; } } ### validation
elsif ($in{'validate_records'}) { if ($per_admin) { &validate_records; } else { &html_unauth; } } ### validation

In your sub html_view_search and search failure you can also add this hidden tag:

<INPUT TYPE=HIDDEN NAME="$db_validated_field" VALUE="Yes">

Hope this helps


Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with Validation Mod In reply to
It is kind of strange, I still have had no luck with it.

You can view the database here: www.canoesforcamps.com/cgi-bin/camps/db.cgi

I added hidden field like you mentioned but it still doesn't seem to work. When you click on "Validate" it still kicks back an unknown action.

Hmmm.

David
Remember, Elvis dies on the throne...
Quote Reply
Re: [akasharkbow] Problem with Validation Mod In reply to
It's hard to guess what could be wrong. Could you save a text copy of your .cfg, cgi, and html.pl files and provide a link to where they can be viewed.



Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with Validation Mod In reply to
Hello there. Sorry for the slow response. You can find the config files here. Any help or suggestions that you can give would be great.

http://www.canoesforcamps.com/db.txt
http://www.canoesforcamps.com/default.txt
http://www.canoesforcamps.com/html.txt

Cheers,

David Pirate
Remember, Elvis dies on the throne...
Quote Reply
Re: [akasharkbow] Problem with Validation Mod In reply to
Not sure if it would make a difference but you should put the following as 3 lines:

elsif ($in{'admin_display'}) { if ($per_admin) { &admin_display; } elsif ($in{'validate_form'}) { if ($per_admin) { &html_validate_form; } else { &html_unauth; } } ### validation
elsif ($in{'validate_records'}) { if ($per_admin) { &validate_records; } else { &html_unauth; } } ### validation


elsif ($in{'admin_display'}) { if ($per_admin) { &admin_display; }
elsif ($in{'validate_form'}) { if ($per_admin) { &html_validate_form; } else { &html_unauth; } } ### validation
elsif ($in{'validate_records'}) { if ($per_admin) { &validate_records; } else { &html_unauth; } } ### validation

Try changing all instances of:

$rec{$db_validated_field}
$in{$db_validated_field}

To:

$rec{'$db_validated_field'}
$in{'$db_validated_field'}

Let me know if this solves your problem.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with Validation Mod In reply to
Still nothing. I am sorry that I am causing so much of a problem. I made the changes and it still didn't work. I double checked that I did everything right at the beginning.

Could it be in the database field section?

Thanks SOOOOO much for your help.

David
Remember, Elvis dies on the throne...
Quote Reply
Re: [akasharkbow] Problem with Validation Mod In reply to
Did you by any chance update the .txt file above? I was looking at them again but didn't see the changes.

Is the field being displayed correctly in your database as yes or no?

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with Validation Mod In reply to
Hello there. I have updated the files.

The field isn't being displayed properly in the database.

Thanks for your help.

David
Remember, Elvis dies on the throne...
Quote Reply
Re: [akasharkbow] Problem with Validation Mod In reply to
Within your html_record_form try using: (If you actual field name is Validated)

|; print &build_radio_field("Validated",$rec{'Validated'}); print qq|

and

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

The only place where it is necessary to use the variable is within the db.cgi file in sub validate_records. The variable version of the mod was created to allow the db.cgi file to be used with relational databases.

You may need to check over your database file or replace it if you are still in the testing phase. I remember when I converted to the version using the variable my db file became corrupted. I'm still testing to see if everything including the validation is working correctly in that db, but have been sidetracked working on another site.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with Validation Mod In reply to
I will try this. Is there anywhere in particular where I should put it in the sub html_record?

Cheers,

David
Remember, Elvis dies on the throne...
Quote Reply
Re: [akasharkbow] Problem with Validation Mod In reply to
Where you have it placed is just fine.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with Validation Mod In reply to
I think that we are moving ahead. The only problem is that I still get an unknown action when I got the "Validate" when I log in as an admin.

Thanks again.
Remember, Elvis dies on the throne...
Quote Reply
Re: [akasharkbow] Problem with Validation Mod In reply to
Look like you may have validation codes before the completetion of the previous line for admin_display in sub main

you have:

elsif ($in{'modify_record'}) { if ($per_mod) { &modify_record; } else { &html_unauth; } }
elsif ($in{'admin_display'}) { if ($per_admin) { &admin_display; }
elsif ($in{'validate_form'}) { if ($per_admin) { &html_validate_form; } else { &html_unauth; } } ### validation
elsif ($in{'validate_records'}) { if ($per_admin) { &validate_records; } else { &html_unauth; } } ### validation
else { &html_unauth; } }

It should be:

elsif ($in{'modify_record'}) { if ($per_mod) { &modify_record; } else { &html_unauth; } }
elsif ($in{'admin_display'}) { if ($per_admin) { &admin_display; } else { &html_unauth; } }
elsif ($in{'validate_form'}) { if ($per_admin) { &html_validate_form; } else { &html_unauth; } } ### validation
elsif ($in{'validate_records'}) { if ($per_admin) { &validate_records; } else { &html_unauth; } } ### validation

Hope this solves the problem

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Problem with Validation Mod In reply to
Hello there. I gave up and installed the database base again. This time I got it working. Thanks so much for your help. I really apreciate it.

Cheers,

David
Remember, Elvis dies on the throne...