Gossamer Forum
Home : Products : DBMan : Customization :

Redirection based on submission

Quote Reply
Redirection based on submission
This is the scenario I would like to implement:
1. On the home page I would like a visitor to choose a category in which their listing should appear using form pulldown menu with redirection javascript.
2. Based on their selection I would like a visitor to be presented with an Add Record Form with Keywords choices specific to the category of their choice. The category would be written to a database as a hidden input
This is what I have tried to do myself, but run into problem:
I generated an HTML page with a Add Record Form with hidden input for a specific category, and default uid. The problem I have is that one of the fields has to be unique and generated by a perl and I do not know what to input in a this unique fields in my case "ID" and "Date" to triger the db.cgi routine. I am trying to implement the scenerio using HTML because I am not a perl programmer .
Could you point me to a right direction to solve my problem.
Thank you
Anita
Quote Reply
Re: Redirection based on submission In reply to
If your $db_key is a "numer" field and you have $db_key_track set to 1, then when html_add_form uses the line

&html_record_form(&get_defaults);

the key should be entered in automatically. The same with the date, if you have &get_date as the default value for the date field.



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





Quote Reply
Re: Redirection based on submission In reply to
I am not sure if I explained my problem properly. I think your suggestion will work if I was creating my Add Form inside html.pl.
This is not what I am doing I have different HTML add form depending on what category visitor will choose their listing to be in.
The category their choose is coded in the form as an hidden input. Date and ID is generated automatically if the html.pl is used in my case do I have to use a user to input date and ID manually? I would prefer not to do that. Does this make more sense then my previous message.
Thank you
Anita
Quote Reply
Re: Redirection based on submission In reply to
I guess I still don't understand, then. Sorry. Maybe somebody else will be able to take a shot at it.


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





Quote Reply
Re: Redirection based on submission In reply to
Can we assume anyone can add records and we don't need to worry about logging the user in first?

If so, then create an html page with the Category selection box, and the hidden tags:

add_form=1
uid=default
db=default

Then, modify get_defaults in db.cgi and change:

$default{$field} = $db_defaults{$field};

to:

$default{$field} = $db_defaults{$field} | | $in{$field};

This will say set the field to a default if you've defined a default in the config, or to some form input.

Now, when you get to the add form you should have the category variable already filled out.

Hope this helps,

Alex
Quote Reply
Re: Redirection based on submission In reply to
Maybe I will ask my question in a new way.
Can the ADD Form have two part of submission.
Based on the choices made in the first part the user will be presented with a second form with pull down menu choices based on the choice made in a first part. Another words can a addition to a form triget different form with fields specific to choices made in the first part.
Can someone help
Anita
Quote Reply
Re: Redirection based on submission In reply to
I have tried what you suggested and I was getting sytax errors. Besides I was having problem with date and id, so this suggestion would have not solve my problem. I think I have to settle for one add record form for different categories of submission instead of different form for each category. Thank you Alex for your effords to help me.
Anita