By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

Python CGI and Firefox vs IE

P: n/a
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.py' method=post>
<button name='display' value='all,status' type='submit'>All
Servers</button>
<button name='display' value='wkpea1,status'
type='submit'>WKPEA1</button>
<button name='display' value='wknha2,status'
type='submit'>WKNHA2</button>
</form>
And the code that's messing things up:

fields = cgi.FieldStorage()

if fields.has_key('display'):
print fields['display']
which_server,which_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

MiniFieldStorage('display', 'all,status')

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

[MiniFieldStorage('display', 'All Servers'),
MiniFieldStorage('display', 'WKPEA1'), MiniFieldStorage('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

Sep 7 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Wed, 07 Sep 2005 10:50:15 -0700, Jason wrote:
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.py' method=post>
<button name='display' value='all,status' type='submit'>All
Servers</button>
<button name='display' value='wkpea1,status'
type='submit'>WKPEA1</button>
<button name='display' value='wknha2,status'
type='submit'>WKNHA2</button>
</form>
And the code that's messing things up:

No, here you are wrong. IE doesn't work as expected with buttons.
See
http://www.solanosystems.com/blog/ar...utton-problem/

This has nothing to do with Python.
---
Stephan jason


Sep 7 '05 #2

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


Try giving the buttons different name attributes.

Sep 7 '05 #3

P: n/a
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.

Sep 7 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.