basic cgi button question

K

Kornelis

I would like to know why sending and retrieving a value with cgi
code like

<button type="submit" name="show" value="y"> show </button>

and

if ($show eq "y") {
print qq| test ie: show eq y.... |;
}

works fine in firefox, mozilla or konqueror, but does nothing at all
in internet explorer.

A test version is at http://www.jiten.nl/cgi-bin/testie.cgi
and its code at http://www.jiten.nl/cgi-bin/testie.txt .


It seems really basic, but I would really appreciate help...

Kornelis
 
A

Alan J. Flavell

I would like to know why sending and retrieving a value with cgi
code like

<button type="submit" name="show" value="y"> show </button>

and

if ($show eq "y") {

Well, you haven't showed how you parsed your CGI query parameters into
that variable $show, but I'm going to make certain assumptions...
works fine in firefox, mozilla or konqueror, but does nothing at all
in internet explorer.

The usual explanation: MSIE doesn't implement the <button> to
specification. This has nothing to do with Perl, it would be as bad
with any other server-side language.
It seems really basic, but I would really appreciate help...

In a web context, I'd recommend not using <button>, but use <input
type="submit" ...>, chiefly for accessibility reasons, but
incidentally because it happens to be supported by MesSIE, which I
know that some misguided webnauts use in the belief that it's a web
browser.

In a usenet context, I'd recommend asking web-related questions on a
web-related usenet group. Have you read the posting guidelines for
this Perl group, posted here frequently?

good luck.
 
G

Gunnar Hjalmarsson

Kornelis said:
I would like to know why sending and retrieving a value with cgi
code like

<button type="submit" name="show" value="y"> show </button>

and

if ($show eq "y") {
print qq| test ie: show eq y.... |;
}

works fine in firefox, mozilla or konqueror, but does nothing at all
in internet explorer.

If you try this script in Explorer, you'll notice that it submits
something, but not what you told it:

#!/usr/bin/perl
print "Content-type: text/html\n\n";

my $q = $ENV{QUERY_STRING};
print "<pre>$q</pre>\n" if $q;

print <<FORM;
<form action="test.pl">
<button type="submit" name="show" value="y"> click </button>
</form>
FORM

__END__

But if you want to know _why_, please ask at http://www.microsoft.com/

Until they answer, why don't you just use

<input type="hidden" name="show" value="y">
<input type="submit" value=" show ">
 
K

Kornelis

Alan said:
Well, you haven't showed how you parsed your CGI query parameters into
that variable $show, but I'm going to make certain assumptions...




The usual explanation: MSIE doesn't implement the <button> to
specification. This has nothing to do with Perl, it would be as bad
with any other server-side language.




In a web context, I'd recommend not using <button>, but use <input
type="submit" ...>, chiefly for accessibility reasons, but
incidentally because it happens to be supported by MesSIE, which I
know that some misguided webnauts use in the belief that it's a web
browser.

In a usenet context, I'd recommend asking web-related questions on a
web-related usenet group. Have you read the posting guidelines for
this Perl group, posted here frequently?

good luck.
thanks for your swift reply.

I settled on posting here, because more cgi related groups that I
could find on my newsserver all had a very low output. I'm sorry,

Kornelis.
 
A

Alan J. Flavell

I settled on posting here, because more cgi related groups that I
could find on my newsserver all had a very low output.

Well, I think you've had answers to your substantive question now,
from at least two of us here (Gunnar and myself), but I'm afraid you
lose some usenet brownie points for that reply...

You remind me of the fellow who lost a dollar in a dark corner, but
looks for it under the street lamp where it's easier to search.

If you're talking about comp.infosystems.www.authoring.cgi (beware its
automoderation bot) then be assured that there are people reading it,
even if the traffic is quite low, and a reasonable question is likely
to elicit one or more reasonable responses.

Whereas folks who continue to post here with questions that are
evidently about CGI - and have very little Perl content - are doomed
to very quickly exhaust their supply of usenet brownie points, as a
review of previous postings here would reveal. I'm just telling you
this in your own interest (and for the benefit of anyone else who
happens to be reading) - it's the way things are around here.

As we often say, the key to solving a complex problem is understanding
how to partition it into smaller problem domains. Everyone who is in
that kind of situation needs to develop expertise in doing that, and
in that sense, partitioning your kind of problem into the HTML markup,
the client agent (browser) submission action, the server-side CGI
(software interface), and the coding of a CGI process in one or other
appropriate language, are all a part of that problem-solving activity,
and the partitioning should help to focus on an appropriate
usenet group for their problem. The Perlfaq9 also points out that
problems that appear to be about the CGI have their own usenet group,
and that this (c.l.p.misc) isn't it.

Anyone who's genuinely still having difficulty with the partitioning
aspect of problem solving would, I think, get an initially sympathetic
reception here, but only in the sense of being urged to concentrate on
their problem-solving practice, to improve their problem domain
partitioning. Usenet likes to help those who say enough to reveal
that they are trying to help themselves - and searching under the
streetlamp where the light is better does not really give the readers
the right impression, I think it's fair to say.

Anyway, I've had my rant. I won't press the point any further.

Good luck.
 
K

Kornelis

Gunnar said:
If you try this script in Explorer, you'll notice that it submits
something, but not what you told it:

#!/usr/bin/perl
print "Content-type: text/html\n\n";

my $q = $ENV{QUERY_STRING};
print "<pre>$q</pre>\n" if $q;

print <<FORM;
<form action="test.pl">
<button type="submit" name="show" value="y"> click </button>
</form>
FORM

__END__

But if you want to know _why_, please ask at http://www.microsoft.com/

Until they answer, why don't you just use

<input type="hidden" name="show" value="y">
<input type="submit" value=" show ">
Thank you. I will follow your advise. I started using the button tag because
it was an easy way to allow users to click for different options. I had no idea
that the button was unsupported, I thought I was missing something very basic.
 
K

Kornelis

Alan said:
Well, I think you've had answers to your substantive question now,
from at least two of us here (Gunnar and myself), but I'm afraid you
lose some usenet brownie points for that reply...

You remind me of the fellow who lost a dollar in a dark corner, but
looks for it under the street lamp where it's easier to search.

If you're talking about comp.infosystems.www.authoring.cgi (beware its
automoderation bot) then be assured that there are people reading it,
even if the traffic is quite low, and a reasonable question is likely
to elicit one or more reasonable responses.

Whereas folks who continue to post here with questions that are
evidently about CGI - and have very little Perl content - are doomed
to very quickly exhaust their supply of usenet brownie points, as a
review of previous postings here would reveal. I'm just telling you
this in your own interest (and for the benefit of anyone else who
happens to be reading) - it's the way things are around here.

As we often say, the key to solving a complex problem is understanding
how to partition it into smaller problem domains. Everyone who is in
that kind of situation needs to develop expertise in doing that, and
in that sense, partitioning your kind of problem into the HTML markup,
the client agent (browser) submission action, the server-side CGI
(software interface), and the coding of a CGI process in one or other
appropriate language, are all a part of that problem-solving activity,
and the partitioning should help to focus on an appropriate
usenet group for their problem. The Perlfaq9 also points out that
problems that appear to be about the CGI have their own usenet group,
and that this (c.l.p.misc) isn't it.

Anyone who's genuinely still having difficulty with the partitioning
aspect of problem solving would, I think, get an initially sympathetic
reception here, but only in the sense of being urged to concentrate on
their problem-solving practice, to improve their problem domain
partitioning. Usenet likes to help those who say enough to reveal
that they are trying to help themselves - and searching under the
streetlamp where the light is better does not really give the readers
the right impression, I think it's fair to say.

Anyway, I've had my rant. I won't press the point any further.

Good luck.

I alreadly tried to apologize, even though in retrospect the words I used
seem to fall short of "het spijt mij", and my confession that I could not
find other groups that posted as much on this topic, naive. As for the rant,
it only hurts me, and tells me to go away, which I will.
 
A

Alan J. Flavell

Alan J. Flavell wrote:
[snipped comprehensive quote]
As for the rant, it only hurts me, and tells me to go away, which I
will.

Then it's a pity that I spent time and effort trying to write
something helpful for you (and anyone else who might benefit from it).
If I'd wanted to tell you to get lost, I could have done it with so
much less effort. Ho hum. Anyway, this isn't my personal usenet
group, not by a long way: I was only trying to summarise for you (with
what were supposed to be helpful suggestions) the general attitude of
this group to questions that don't have much Perl content to them, as
learned from a longer period of participating here myself.

If and when you have a question about using the Perl language, which
also just happens to concern the CGI, then I'm sure the group will be
only too happy to deal with your question in detail.

I'm done with this thread now.

good luck
 
G

Gunnar Hjalmarsson

Kornelis said:
Thank you. I will follow your advise. I started using the button tag
because
it was an easy way to allow users to click for different options.

The input element is just as easy if you can live with values that equal
the button labels.

<input type="submit" name="color" value="Blue">
<input type="submit" name="color" value="Red">
<input type="submit" name="color" value="Green">
 

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,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top