The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help making a Form, Form to create URL "Link" that will be clicked via submit bu
Fakshon
post Nov 3 2009, 10:34 PM
Post #1





Group: Members
Posts: 3
Joined: 3-November 09
Member No.: 10,224



Hi,

I am trying to develop a form that does this:

List one chooses a City (variable 1):

Austin = 214 (term ID)
Los Angeles = 215 (term ID)
Chicago = 216 (term ID)

List two chooses a type of restaurant (variable 2):

Tex-Mex = ,415 (term ID)
Italian = ,416 (term ID)
American = ,417 (term ID)

Which will complete a url

www.examplesite.com/taxonomy/term/(variable 1),(variable 2)

Then a form Submit Button that will:

Click the link to the dynamic link that was created by the form.


Which will cause the page to go to:

www.examplesite.com/taxonomy/term/214,415


I hope this is understandable.

Thanks,

Fakshon
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Nov 3 2009, 10:59 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 5,144
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



HTML forms don't work that way, but you could have a server-side (e.g., CGI, PHP) or client-side (JavaScript) program redirect to the desired URL.


--------------------
Darin McGrew
WDG Member since 1998

My involvement with the WDG is personal. The views I express here are mine alone and not those of my employer.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Fakshon
post Nov 4 2009, 09:13 PM
Post #3





Group: Members
Posts: 3
Joined: 3-November 09
Member No.: 10,224



I am currently using Drupal to develop my site which uses PHP. I myself don't know enough about PHP but I am in need of creating this function. Any help would be greatly appreciated.

Thanks,

Tone
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 5 2009, 08:41 AM
Post #4


¤¤¤¤¤¤¤¤¤
********

Group: WDG Moderators
Posts: 2,371
Joined: 10-August 06
Member No.: 7



QUOTE(Fakshon @ Nov 4 2009, 04:34 AM) *

Which will cause the page to go to:

www.examplesite.com/taxonomy/term/214,415

Normally, submitted form fields (with submit method GET) create a URL with the name/value pairs of the form fields, not just the values like in your example above. To change it you may have to use e.g. PHP like Darin suggested.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Nov 5 2009, 10:29 AM
Post #5


Jocular coder
*******

Group: Members
Posts: 1,431
Joined: 31-August 06
Member No.: 43



QUOTE
www.examplesite.com/taxonomy/term/(variable 1),(variable 2)


Is this destination page under your control? If so, it would be much more sensible to let it accept arguments in the conventional format generated by a form (as Christian said). Where are these numbers ("214=Chinese cooking" or whatever it was) coming from??
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 21st November 2009 - 10:37 AM