Python CGI and Firefox vs IE

J

Jason

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
 
S

Stephan Diehl

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/archives/2005/04/12/the-submit-button-problem/

This has nothing to do with Python.
 
I

infidel

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.
 
J

Jason

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top