PDA

View Full Version : need script go to web page depending on checkbox selected



cwebmaster
06-13-2008, 09:54 AM
Hi

I am looking for help on a script that has a row of checkboxes, A user can then select 1 or more checkboxes, and then have a button, when clicked allows the user to go the the web page, depending on which checkbox was
selected.

Thanks Dave

rangana
06-13-2008, 10:02 AM
What are you expecting to happen? Open in the same page or open in a new window?

If it's the earlier, then impossible. If it's the later, there's possibility.

rangana
06-14-2008, 02:10 AM
...and this was resolved:
http://codingforums.com/showpost.php?p=700187&postcount=3

cwebmaster
06-14-2008, 02:18 AM
This was not resolved, please do not reply with out knowing if it can be done, you say it can not be done, when it can, I have seen it, you can too.

see for yourself.

http://www.horizonindustriesltd.com/s/QwikReport.asp

rangana
06-14-2008, 02:36 AM
As I say, it can't be done! Or you're not making yourself clear.

You never answered my query on post#2, as well as the message you've sent to me.
If you could answer the question on post#2, I'll be glad to hand a code for you.

cwebmaster
06-14-2008, 11:24 AM
I do not know why you keep saying it is not possible, Please have a look at
http://www.horizonindustriesltd.com/s/QwikReport.asp

They have done what i want done. You will be taken to a web page, depending on which checkbox...or checkboxes are selected. You can check more than 1 checkbox, and if you check 4 of those checkboxes, you will be taken to a page with the 4 articles. etc (and opens in same page)

Thanks dave

rangana
06-14-2008, 11:35 AM
Then, this means we're not riding on the same boat.
What I'm I going to do next upon checking the checkbox?
I can't reproduce what you're trying to achieve. Sorry if I'm giving you a hard time.

cwebmaster
06-15-2008, 11:10 PM
I want the viewer to check in a box, if they only choose 1 checkbox, they go to that page, if they check 2 checkboxes, then they go to another page and so on.

Did you see the example i posted?
http://www.horizonindustriesltd.com/s/QwikReport.asp

If they check one box, they go to a page with that 1 article, if they check two checkboxes, then they go to the page, with both those checked articles in it, and so on.

Thanks dave

Medyman
06-16-2008, 01:11 AM
I want the viewer to check in a box, if they only choose 1 checkbox, they go to that page, if they check 2 checkboxes, then they go to another page and so on.

Did you see the example i posted?
http://www.horizonindustriesltd.com/s/QwikReport.asp

If they check one box, they go to a page with that 1 article, if they check two checkboxes, then they go to the page, with both those checked articles in it, and so on.

Thanks dave

I think you're highly underestimating or misunderstanding what's being done here. The second page you're taken to, the "results" page, is generated dynamically based on what you selected on the first page.

The contents of the second page are all saved to a database (could be text files etc.. as well, it's hard to say), and called on demand.

It's not just a matter of going to one page if option A is selected and going to another page if option B is selected. Doing it that way would be a complete waste of time/resources. Depending on your setup, there could be tens or hundreds of permutations.

So, if you want to replicate the functionality of the page you posted, you'll have to rethink your setup and develop some sort of dynamic way of doing this. You'll need some sort of server-side language available on your server (PHP, ASP and the like). A database (MS SQL, MySQL, etc...) is optional.

jscheuer1
06-16-2008, 04:05 AM
This could all be done with AJAX and javascript. The script might be a bit complex, and it would depend upon the client having javascript enabled. Because of that (client requirement), and the fact that AJAX requires server resources anyway, a 100% server side solution as hinted at by Medyman would be better. Do you have PHP or asp available on your host?

Here's a demo of the javascript/AJAX method:

1838

or:

http://home.comcast.net/~jscheuer1/side/fetch/sender.htm

cwebmaster
06-17-2008, 04:13 AM
Yes I have php but not ASP

Dave

cwebmaster
06-17-2008, 04:26 AM
Thanks jscheuer1

Your zip file ....javascript/AJAX method...is exactly want I was looking for, It will work fine for my site.

Cheers Dave

jscheuer1
06-17-2008, 05:55 AM
Yes I have php but not ASP

You only need one or the other, and PHP is more widely known around here, so you could probably get more help with it in these forums.


Thanks jscheuer1

Your zip file ....javascript/AJAX method...is exactly want I was looking for, It will work fine for my site.

Well, it does have certain advantages over PHP, but it won't work for users without javascript enabled. If you have PHP, we could perhaps modify the script to use the PHP post method and (when available) javascript.

That way it would work for folks regardless of whether they had javascript enabled or not.