Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

choose between add_form1 and add_form2

Quote Reply
choose between add_form1 and add_form2
Hi All,

I want to have my customers to choose a different add forms with a radio-button or a button.

1) normally they have to choose add link (add.cgi is triggered now)
2) now they must choose between form1 or from2
3) when they choose 1 form1 must be opened and when they choose 2 form2 must be opened

I made already a include_form1 and a include_form2.
How can I let my customers choose??

Thanks,
Ron

Last edited by:

rsahertian: Jan 20, 2004, 7:09 AM
Quote Reply
Re: [rsahertian] choose between add_form1 and add_form2 In reply to
I wrote an 'intermeditory' for this. I basically rewrote add.cgi, and had my own addition codes put in there, and a few other bits, which would use Links::SiteHTML to display the add forms correctly, whilst also letting them decide which type of link they want to add.

Not sure how much help that is... but thats how I did it :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] choose between add_form1 and add_form2 In reply to
thanks.... Andy

and how did you do it???
Crazy
Quote Reply
Re: [rsahertian] choose between add_form1 and add_form2 In reply to
I'm afraid I don't have a copy to hand, sorry.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [rsahertian] choose between add_form1 and add_form2 In reply to
Hi,

I use different versions of the Add Form by setting a variable on the add.cgi link:

In other words:

Add Form #1 Link: /add.cgi?form_version=1

Add Form #2 Link: /add.cgi?form_version=2

Then on the add.html template you could add the tags something like:

<%if form_version = '1'%>
<%include form1.txt%>
<%elseif form_version = '2'%>
<%include form2.txt%>
<%endif%>

--Frank
Quote Reply
Re: [FrankM] choose between add_form1 and add_form2 In reply to
Definatly a lot simpler :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [FrankM] choose between add_form1 and add_form2 In reply to
Great Frank.....

When I see that piece of code, I think, it's so simple... but bringing the idea is something different....

thanks,
ron
CrazyWink
Quote Reply
Re: [FrankM] choose between add_form1 and add_form2 In reply to
Frank,

Does this trick also work with modifying??

thanks,
Ron
Quote Reply
Re: [rsahertian] choose between add_form1 and add_form2 In reply to
Hi Ron,

I also do this in a similar way to Frank. But I've added a new field to the Links database which reads in a value from the form. So include_form1.html would have <input type=hidden name=type value=1> and include_form2.html would have <input type=hidden name=type value=2> within the form (or something more descriptive). Then when you are modifying you can just have <%if type=1%>include form 1... etc.

Laura.