Python CGI and Firefox vs IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason

    #1

    Python CGI and Firefox vs IE

    Hey y'all, this falls under the murky realm of HTML, CGI and
    Python...and IE.

    Python 2.4, using CGI to process a form.

    Basically I've got 3 buttons. Here's the HTML code:

    <form action='http://127.0.0.1/cgi-bin/server_status.p y' method=post>
    <button name='display' value='all,stat us' type='submit'>A ll
    Servers</button>
    <button name='display' value='wkpea1,s tatus'
    type='submit'>W KPEA1</button>
    <button name='display' value='wknha2,s tatus'
    type='submit'>W KNHA2</button>
    </form>


    And the code that's messing things up:

    fields = cgi.FieldStorag e()

    if fields.has_key( 'display'):
    print fields['display']
    which_server,wh ich_display = fields['display'].value.split(', ')
    if which_server == 'all':
    which_server = servers
    else:
    which_server = [which_server]


    This program works fine under firefox. If, say, you clicked on the 1st
    button, All Servers, you'd get this returned in the field['display']
    variable

    MiniFieldStorag e('display', 'all,status')



    Under Internet Explorer, this is what I get in field['display']:

    [MiniFieldStorag e('display', 'All Servers'),
    MiniFieldStorag e('display', 'WKPEA1'), MiniFieldStorag e('display',
    'WKNHA2')]


    ----

    I see what's happening, but I'm at a loss to figure out what to do
    about it. Any help would be appreciated.

    thanks,

    jason

  • Stephan Diehl

    #2
    Re: Python CGI and Firefox vs IE

    On Wed, 07 Sep 2005 10:50:15 -0700, Jason wrote:
    [color=blue]
    > Hey y'all, this falls under the murky realm of HTML, CGI and
    > Python...and IE.
    >
    > Python 2.4, using CGI to process a form.
    >
    > Basically I've got 3 buttons. Here's the HTML code:
    >
    > <form action='http://127.0.0.1/cgi-bin/server_status.p y' method=post>
    > <button name='display' value='all,stat us' type='submit'>A ll
    > Servers</button>
    > <button name='display' value='wkpea1,s tatus'
    > type='submit'>W KPEA1</button>
    > <button name='display' value='wknha2,s tatus'
    > type='submit'>W KNHA2</button>
    > </form>
    >
    >
    > And the code that's messing things up:
    >[/color]

    No, here you are wrong. IE doesn't work as expected with buttons.
    See


    This has nothing to do with Python.
    ---
    Stephan[color=blue]
    > jason[/color]

    Comment

    • infidel

      #3
      Re: Python CGI and Firefox vs IE

      > I see what's happening, but I'm at a loss to figure out what to do[color=blue]
      > about it. Any help would be appreciated.[/color]

      Try giving the buttons different name attributes.

      Comment

      • Jason

        #4
        Re: Python CGI and Firefox vs IE

        IE...<sigh>

        Have to come up with a workaround, go back to the old <input>. I'm
        about the only one who uses firefox in our facility.

        Thanks for the reply and the link.

        Comment

        Working...