Python CGI and Firefox vs IE
Jason
jason.massey at gmail.com
Wed Sep 7 13:50:15 EDT 2005
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
More information about the Python-list
mailing list