basic cgi button question

Discussion in 'Perl Misc' started by Kornelis, Aug 14, 2005.

  1. Kornelis

    Kornelis Guest

    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



    --
    * http://promulgate.xs4all.nl
     
    Kornelis, Aug 14, 2005
    #1
    1. Advertising

  2. On Sun, 14 Aug 2005, Kornelis wrote:

    > 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.
     
    Alan J. Flavell, Aug 14, 2005
    #2
    1. Advertising

  3. Re: OT basic cgi button question

    Kornelis wrote:
    > 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 ">

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Aug 14, 2005
    #3
  4. Kornelis

    Kornelis Guest

    Alan J. Flavell wrote:
    > On Sun, 14 Aug 2005, Kornelis wrote:
    >
    >
    >>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.

    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.

    --
    * http://promulgate.xs4all.nl
     
    Kornelis, Aug 14, 2005
    #4
  5. On Sun, 14 Aug 2005, Kornelis wrote:

    > 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.
     
    Alan J. Flavell, Aug 14, 2005
    #5
  6. Kornelis

    Kornelis Guest

    Re: OT basic cgi button question

    Gunnar Hjalmarsson wrote:
    > Kornelis wrote:
    >
    >> 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 ">
    >

    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.
     
    Kornelis, Aug 14, 2005
    #6
  7. Kornelis

    Kornelis Guest

    Alan J. Flavell wrote:
    > On Sun, 14 Aug 2005, Kornelis wrote:
    >
    >
    >>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.


    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.
     
    Kornelis, Aug 14, 2005
    #7
  8. On Sun, 14 Aug 2005, Kornelis wrote:

    > 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
     
    Alan J. Flavell, Aug 14, 2005
    #8
  9. Re: OT basic cgi button question

    Kornelis wrote:
    > Gunnar Hjalmarsson wrote:
    >> 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.


    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">

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Aug 14, 2005
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ali
    Replies:
    8
    Views:
    834
    Peter Hansen
    Dec 20, 2004
  2. Engineer
    Replies:
    6
    Views:
    628
    Jeremy Bowers
    May 1, 2005
  3. Replies:
    0
    Views:
    439
  4. Robert Sedlacek

    Basic CGI.pm question

    Robert Sedlacek, Dec 22, 2004, in forum: Perl Misc
    Replies:
    10
    Views:
    327
    Eric Bohlman
    Dec 26, 2004
  5. Ted Byers
    Replies:
    19
    Views:
    687
    Ilya Zakharevich
    Nov 30, 2009
Loading...

Share This Page