Double Jump Box Redirection

K

Kenton

Hi

Been pulling my hair out for hours on this one and I was wondering if
anyone could help.

I would like two drop down lists for navigation.
One to select state and one to select product.
So that selecting option 1, option 1 gives you
http://www.example.com/state_1/product1.htm

I started using javascript but in my travels have been scared off it.

So that leave me with pearl.

Given I have a form (remnants of my JS) with 2 drop down lists similar
to below can pearl cope with the redirect or do I need something
different?

<form name="RegionProduct" method="get" action="">
<select name="region" size="1" >
<option selected value="">Select your region</option>
<option value="state_1/">state 1</option>
<option value="state_2/">state 2</option>
</select>
<select name="service" size="1" >
<option selected value="index.htm">Select service</option>
<option value="widgets.htm">Widgets</option>
<option value="wodgets.htm">Wodgets</option>
</select>
<input name="button" type="button" onClick="????????????????"

Any help would be greatly appreciated
Kenton
 
G

Gregory Toomey

Kenton said:
Hi

Been pulling my hair out for hours on this one and I was wondering if
anyone could help.

So that leave me with pearl.


Any help would be greatly appreciated
Kenton

This is HTML coding, not "pearl". Try a html group.

gtoomey
 
K

Keith Keller

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would like two drop down lists for navigation.
One to select state and one to select product.
So that selecting option 1, option 1 gives you
http://www.example.com/state_1/product1.htm

I started using javascript but in my travels have been scared off it.

So that leave me with pearl.

Perhaps you should post in a pearl newsgroup. If you have any
actual Perl code, you can post it here.

- --keith

- --
(e-mail address removed)-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAPr+bhVcNCxZ5ID8RAgGzAJ9zqZ6ocgiiql9Eul5bdaAFDI7DxACeICu8
VPsCoz3/dQTm4w6nALwKaY4=
=UuB6
-----END PGP SIGNATURE-----
 
M

Martien Verbruggen

Hi

Been pulling my hair out for hours on this one and I was wondering if
anyone could help.
http://www.wigs.com/

I would like two drop down lists for navigation.
One to select state and one to select product.
So that selecting option 1, option 1 gives you
http://www.example.com/state_1/product1.htm

Perl has no drop down lists. Are you talking about HTML?
I started using javascript but in my travels have been scared off it.

JavaScript is most often used together with HTML, so I suspect that
you are.
So that leave me with pearl.

This newsgroup is called comp.lang.perl.misc. I find it interesting
that you succeeded in posting to this group without realising that the
language does not have an 'a' in its name.

Besides that, in web-related programming JavaScript and Perl are
generally used for two very different things. JavaScript is most
commonly used for client-side scripting, and Perl for server-side
programming.

I'd say, from the utterly vague description that you give, that
JavaScript would probably be what you want.

One of the groups in the comp.infosystems.www.* hierarchy can probably
help you further.

Martien
 
M

Matt Garrish

Martien Verbruggen said:
This newsgroup is called comp.lang.perl.misc. I find it interesting
that you succeeded in posting to this group without realising that the
language does not have an 'a' in its name.

Besides that, in web-related programming JavaScript and Perl are
generally used for two very different things. JavaScript is most
commonly used for client-side scripting, and Perl for server-side
programming.

I'd say, from the utterly vague description that you give, that
JavaScript would probably be what you want.

One of the groups in the comp.infosystems.www.* hierarchy can probably
help you further.

Or good old comp.lang.javascript...

Matt
 
S

Sandman

Hi

Been pulling my hair out for hours on this one and I was wondering if
anyone could help.

I would like two drop down lists for navigation.
One to select state and one to select product.
So that selecting option 1, option 1 gives you
http://www.example.com/state_1/product1.htm

I started using javascript but in my travels have been scared off it.

So that leave me with pearl.

Given I have a form (remnants of my JS) with 2 drop down lists similar
to below can pearl cope with the redirect or do I need something
different?

<form name="RegionProduct" method="get" action="">
<select name="region" size="1" >
<option selected value="">Select your region</option>
<option value="state_1/">state 1</option>
<option value="state_2/">state 2</option>
</select>
<select name="service" size="1" >
<option selected value="index.htm">Select service</option>
<option value="widgets.htm">Widgets</option>
<option value="wodgets.htm">Wodgets</option>
</select>
<input name="button" type="button" onClick="????????????????"

Any help would be greatly appreciated
Kenton

All you seem to have recieved was attitude.

What you want to do is quite possible with perl, allthough not using the method
you would use with JavaScript.

As others have pointed out, JavaScript is a client-side scripting language,
meaning you can write code ein your html that the web browser will perform.
Perl, on the other hand, is server-side scripting, meaning that a browser
couldn't cope with perl code, but you can run perl scripts to generate code
that a browser can deal with, such as HTML or even JavaScript.

To solve your problem in JavaScript, you would use a function pretty much like
this:

function go(){
top.location = "http://www.example.com/" + document.formName.region[document.formName.region.selectedIndex].value +
"/" + document.formName.service[document.formName.service.selectedIndex].value
+ ".htm";
}

And then call on function go() in your onclick="".

Using perl, you would have to use a "proxy-script" that will take the values of
those two popups as post/get-data and then redirect the browser accordingly. A
script that looks something like this (been a while since I used CGI though):

#!/usr/bin/perl
use CGI;
ReadParse;
print "Location: http://www.example.com/$in{region}/$in{service}.htm\n\n";

I think you'd be better off doing this in JavaScript, though.
 
K

Kenton

Sandman said:
All you seem to have recieved was attitude.

You're not wrong ... thanks for your help Sandman, nuts to the rest of
you.

I am fully aware that what I had was JS.
Sorry if that wasn't clear.

I also said that I'd been scared off JS which is why I wasn't posting
to a JS group.
Sorry if that wasn't clear.

I listed the JS just to show what I already had (and wanted to
replace)
Sorry if that wasn't clear.

I wanted to use a cgi script and I thought this was an appropriate
place to post.
Sorry if that wasn't clear.

Bugger it ... Javascript programmers are friendlier I'll just go and
see them and do it their way. Obviously 5/6 perl programmers are rude.
 
S

Sandman

You're not wrong ... thanks for your help Sandman, nuts to the rest of
you.

I am fully aware that what I had was JS.
Sorry if that wasn't clear.

I also said that I'd been scared off JS which is why I wasn't posting
to a JS group.
Sorry if that wasn't clear.

I listed the JS just to show what I already had (and wanted to
replace)
Sorry if that wasn't clear.

I wanted to use a cgi script and I thought this was an appropriate
place to post.
Sorry if that wasn't clear.

Bugger it ... Javascript programmers are friendlier I'll just go and
see them and do it their way. Obviously 5/6 perl programmers are rude.

Not really, but many oldies in this group are eager to complain about what they
feel are posts that aren't up to a certain standard. They have no tolerance for
newbies.

It's a shame, since it's a *.misc group. there are posting "rules" here, and
they are a great reference, but being naive enough to think that everyone
should follow them is a little too much.

You posted to the correct group and I hope my post at least helped some.
 
B

Ben Morrow

If you're looking for help here, talking like that's hardly going to
improve your chances...

What wasn't the least bit clear was that you wanted to replace the JS
with a Perl CGI script. For future reference, a statement along the lines
of 'Here is some JavaScript that I am using currently. I would like to
produce a Perl CGI script that does the same thing.' will work wonders.
Also, many of us do not speak JavaScript, so a concise (and complete)
English description of the problem wouldn't go amiss, either.

Another thing that you seem to unfortunately to have fallen foul of is

Not so much 'are rude' as 'have a different idea of what is rude and
what is not from most of society'. Here, it is considered rude not to
explain yourself properly, or not to take the trouble to make sure you've
spelt the name of the language correctly.
Not really, but many oldies in this group are eager to complain about what
they feel are posts that aren't up to a certain standard. They have no
tolerance for newbies.

s/newbies/clueless newbies/. I joined this group as a newbie a while
ago, and have never found it unfriendly. I was smacked a couple of times
for making stupid mistakes, but that's what you should expect for
stupidity.
It's a shame, since it's a *.misc group. there are posting "rules" here, and
they are a great reference, but being naive enough to think that everyone
should follow them is a little too much.

It's not a question of naivete. It's a question of 'if you're not even
going to bother to read and follow a few simple guidelines, why should I
bother to spend time trying to help you?'.
You posted to the correct group and I hope my post at least helped some.

You are indeed (probably) in the right place, and I would have thought
that if you try again with a little more respect for the conventions of
this group that you will find it not unhelpful.

Ben
 
S

Sandman

If you're looking for help here, talking like that's hardly going to
improve your chances...[/QUOTE]

I don't he will be coming back for more help. :)
What wasn't the least bit clear was that you wanted to replace the JS
with a Perl CGI script.

No?

"I started using javascript but in my travels have been scared off it.
So that leave me with pearl."

Despite the spelling mistakes, it was prety clear to me that he wanted to use
perl instead of JavaScript.
Also, many of us do not speak JavaScript, so a concise (and complete)
English description of the problem wouldn't go amiss, either.

Agreed. However, lack of such a description shouldn't warrant the kind of
replies he recieved.
Another thing that you seem to unfortunately to have fallen foul of is
the assumption that perl <=> CGI. This is very much not the case, and
those of us who know otherwise find it irritating, in the end.

Assuming incorrect things warrants an education, not insults.
Not so much 'are rude' as 'have a different idea of what is rude and
what is not from most of society'. Here, it is considered rude not to
explain yourself properly, or not to take the trouble to make sure you've
spelt the name of the language correctly.

Ergo - not posting according to the posting rules to the last point. Newbies
make no effort here.

For the record - I don't agree with the above. It was quite clear that *I*
could understand his problem and even help him out - and even without giving
him attitude..
s/newbies/clueless newbies/. I joined this group as a newbie a while
ago, and have never found it unfriendly. I was smacked a couple of times
for making stupid mistakes, but that's what you should expect for
stupidity.

No, that's just plain wrong. Being ignorant doesn't mean people have a free
pass at making fun at you. Especially not in a *.misc group.
It's not a question of naivete. It's a question of 'if you're not even
going to bother to read and follow a few simple guidelines, why should I
bother to spend time trying to help you?'.

What I meant was that it is naive to believe that a newbie would actually look
through the group to see if there is a posting rules document (which may or may
not have been posted in time for his feed to have picked it up). Having posting
rules isn't very common on usenet, you know.

I am all FOR posting styles. And when you get your first reference to them (as
he should have gotten, instead of attitude) you can read them and adhere to
them as good as you can.
You are indeed (probably) in the right place, and I would have thought
that if you try again with a little more respect for the conventions of
this group that you will find it not unhelpful.

It is true that the chance of getting help is in direct relation to your
awareness of these documents - but "respect" isn't the right word. It was lack
of respect that brought us here, but not from him.

Some words of wisdoms for our resident oldies:

1. Don't ever EXPECT everyone to have thoroughly read through the FAQ and
posting styles documents for this group before they post their first post.

2. Treat people with respect, and direct them to the above documents when they
are posting things that will make it hard for them to recieve proper help in
this group.

3. Hit the 'cancel' button if you realise that the reply you begun typing is
laced with sarcasm and just plain bad attitude.

4. This isn't a contest. You can't win anything here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top