Moderators: Derry, Goldie, Harpo
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Junior Mechanic
Posted
Hi I'm having a lot of trouble creating a simple "radio_button" type form to navigate fast and easy thrue my site.

So in other words I want to have a simple multiple question field with let say two or three questions that wil bring the visitor directly to the exact page.

example:

Sex: male
female
yes please!

age: <20
>20

etc. etc.

If the visitor would fil in (using the radio_buttons) Male and >20, after pressing submit he should be redirected to a new specific page of his input interrest.

Now, I have tried a lot, read forums on the net for days now but I cant get it to work! Plenty of Form builders on the net, but they all seem to be for Email submit purpose only. And all I want to do is simply; if you choose this, this and that you wil be redirected to the correct page.

Please help!!!
thank you,

regards, Sean
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Picture of mccifa
Posted Hide Post
LarryD has produced exactly what you require. I think he may have e-mailed the solution to me some time ago.....so perhaps he will now broadcast it on here for you/others?

mccifa
 
Posts: 566 | Location: UK | Registered: May 28, 2007Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
I Shure hope so.... This is driving me nuts! I already started building my site using 20 million pages, (page for every question) I should think there must be a more efficient way of spinning the site!

Thank you for your input anyway! It's giving me hope....

Sean
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Creative' Mechanic
Picture of Klimt
Posted Hide Post
Have you checked out SS form Tutorials here? If you build it in SS you'll probably need to use some kind of submit button after the choices are made. Make sure that you use GET as method and yourpage.html as ACTION.
 
Posts: 1724 | Location: Vienna, Austria | Registered: July 17, 2006Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
Hi Klimt, thank you for your reply!

Yes, I have read the SS tutorial over and over.

The problem is actually exactly what your saying. So I have let's say two radio buttons and a submit button in a form. Now if I give the form an URL action let's say "index.html" the output would allways be index.html whatever the input of the radio buttons.

The URL string however displays: index.html?form1=radio+button&form5=submit

The actual answer should be, when I press submit and radio button 1 is selected, I go directly to (let's say) page1.html
and ofcourse to page2.html when radio button 2 is selected and submitted.

regards, Sean
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
Oh yeah, before I forget....

There should ofcouse be multiple forms on 1 page with just 1 submit button to take you directly to your page of interrest.

hmmmm........ getting hard this one
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Creative' Mechanic
Picture of Klimt
Posted Hide Post
I think that what you want to achieve has to be done by the php script placed on your server.
 
Posts: 1724 | Location: Vienna, Austria | Registered: July 17, 2006Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
o-oh.... I was afraid you were going to say something like that.

I don't think I have the skills to do that. Ofcourse one of the reasons I use Sitespinner; It's easy and fun!

I was just checking out the HTML code of a site for searching used cars. It looks as if it should be possible, but if there's going to be scripts made by hand....hmmm I'll just have to settle for the 20 million pages on my site.

Thanks anyway! I hope Larryd has an other solution as mccifa said.....

we wil see!

Sean
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
Hi Sean,

If you can give me a better idea of the exact criteria you require, and how many pages of interest there are, I may be able to knock up some javascript code for you using the “switch” statement (if it’s not too complicated).

The script (either javascript or PHP) should not require multiple forms. Rather, you would have different form elements in the same form with unique names. Then, based on the value of these form elements, clicking the Submit button would trigger the script to decide which page the user should be taken to.
 
Posts: 1147 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
I found the sample project I worked up for mccifa. It uses a form with 2 radio buttons and a small piece of javascript to evaluate which button is checked, then re-loads the specified page in an i-frame.

It sounds like you need multi-button evaluation which can be performed by comparing the multiple button groups. This would be a easy change.

If you are interested, my email address is in my public profile. Send me yours and I'll forward the project file to you.
 
Posts: 5073 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
thank you for the replies!!

postyr, the site is very simple.
It is going to be a tool for people who are looking for P.A. (sound system) for a party (like a wedding party.)
a couple of questions are asked in one field.

first question:
how many guests are you expecting?

a: >50
b: >100
c: >200
d: >500

second question would be:

Is your party inside or outside?

a: inside
b: outside

Submit.


This would determin how much power (watts) you need and which speakerset should be used.

so there are 8 output possibilities wil result in 4 webpages; Speakerset1,2,3,4 plus a contact request when the input request is larger than normal.

so:

Speakerset 1: if guests = >50 and inside
Speakerset 2: if guests = >50 and ouside
Speakerset 2: if guests = >100 and inside
Speakerset 3: if guests = >100 and ouside
Speakerset 3: if guests = >200 and inside
Speakerset 4: if guests = >200 and ouside
Speakerset 4: if guests = >500 and inside
please contact us if guests = >500 and outside

Simple if/and/then structure

this is mainly it, but on the same site there wil be similar pages for different customers, this for example was the wedding party. There wil also be a similar one for people who want to do a buisiness presentation, of event like a popfestival.

The resulting pages wil give the customer a new field with questions about other gear like lighting and dj/band equipment. In the end stage the customer will be able to determin which gear he/she needs and at what price. Next would be a contact form to order. Ofcourse the net is full of contact forms so I don't expect this to be a big issue.

I have noticed that I have to start digging into Java, php etc. so it's back to the schoolbooks for me....

Anyhow all input and examples are welcome!

Larry; Thank you, I just received your mail with your example!
I'll start experimenting in the morning! The Netherlands is going to sleep now.....


Thank's again!

Sean Smile
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary 'Aussie' Mechanic
Picture of postyr
Posted Hide Post
I’ll wait until you have had a play with Larry’s file. I’m sure he would be able to tweak it to do what you want, and is probably similar to what I would probably do.

If you are still having problems with it, let me know.
 
Posts: 1147 | Location: Australia | Registered: April 17, 2007Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
Larry, That was exactly what I needed!!! I'm a happy man now! Smile

So what I did was; changed the Java script a little (didn't know I could do that but it worked!)

made 4 radio buttons. The original script said; If ...blablabla..yn[0] checked ...blablabla href="toast.html"
else blablabla....href="bagel.html"

I presumed that yn[0] would be radiobutton[0]
so I copied and pasted it to a new line and renamed it to yn[1] and so on. deleted the else part, and now it works, great stuff!!!

Now, It still requires me to create the 20million pages. And the trick would be to have at least 2 forms on a single page to make site navigation mor efficient. So I would expect an "and" function in the Javascript....

I guess something like;

If (document.form3 yn[0]checked) and (document.form4 yn[1] checked)
window.location.href="jam on toast.html";

I havn't tried this yet, but it seems logical.

thanks for all your input!!! If you can help me with this last part I would be most greatfull!!

best regards, Sean
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
quote:
If (document.form3.yn[0].checked) and (document.form4.yn[1].checked)
window.location.href="jam on toast.html";
That logic should work. But don't forget that a form can have multiple radio buttons, so instead of using 2 forms, you could use 2 radio button groups on the same page: yn1[] and yn2[]. The logic for this would be:
If (document.form3.yn1[0]checked) and (document.form3.yn2[1] checked)
window.location.href="jam on toast.html";
It would also be helpful for you to give your buttons names you recognize instead of "yn".

In reviewing your outlined requirement, using multiple forms on multiple pages may be overkill. It looks like some of your choices can be presented via a form select list instead of radio buttons. If so, then you can utilize the radio button's onclick event to populate the list with choices (via javascript) based on the state of the radio button(s).
 
Posts: 5073 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
Whoops....I did it!!

I found out on the net that the "and" function in Java is written as; &&

So I took the same script, deleted the () and put in &&.
I cant believe it is actually working....!!!
Man, The Netherlands is a happier place today!

Thank's guys!!!

Sean Smile
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Junior Mechanic
Posted Hide Post
Great stuff larry!
I had not thought of using two groups in 1 form. I did it using two different forms. This looks much more efficient now.

I had changed the names by the way...(yn) was starting to get confusing.

Thanx!

Sean
 
Posts: 9 | Registered: October 04, 2009Reply With QuoteEdit or Delete MessageReport This Post
Honorary Mechanic
Picture of mccifa
Posted Hide Post
quote:
Originally posted by larryd:
I found the sample project I worked up for mccifa. It uses a form with 2 radio buttons and a small piece of javascript to evaluate which button is checked, then re-loads the specified page in an i-frame.

It sounds like you need multi-button evaluation which can be performed by comparing the multiple button groups. This would be a easy change.

If you are interested, my email address is in my public profile. Send me yours and I'll forward the project file to you.


Well done, Larry! Smile

mccifa
 
Posts: 566 | Location: UK | Registered: May 28, 2007Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.