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