Hi,
if I have two submit buttons on my html page, how do I know which one is pressed when using python ?
Example:
<form action="test.py">
<input type=submit name=add value=Add>
<input type=submit name=del value=Del>
</form>
----
def myfunction(req, var1, var2):
???
I can't find anything about this in mod_python documentation, does anyone know ?
Thanks!
/P
4 3036
Hi,
if I have two submit buttons on my html page, how do I know which one is pressed when using python ?
Example:
<form action="test.py">
<input type=submit name=add value=Add>
<input type=submit name=del value=Del>
</form>
----
def myfunction(req, var1, var2):
???
I can't find anything about this in mod_python documentation, does anyone know ?
Thanks!
/P
Hi there,
Am not sure about this too, i suggest to use javascript to handle this issue. Good luck & Take care.
Hi there,
Am not sure about this too, i suggest to use javascript to handle this issue. Good luck & Take care.
But there must be a way to do this in Python. Maybe a separate form for each button ? I'm going to google some more :)
Thanks!
/P
Oh.. it was so simple. Here's the solution.
If you have several submit buttons, all you have to do is go by there value.
Example:
mysite.html
-------------------
<form action=myscript.py method="POST">
Button1:<input type=submit name=submitter value=1>
Button2:<input type=submit name=submitter value=2>
</form>
myscript.py
------------------
def index(req, submitter):
if submitter = 1:
s = "Button 1 is pressed"
else:
s = "Button 2 is pressed"
return s
Regards
/P
Hi there,
Am not sure about this too, i suggest to use javascript to handle this issue. Good luck & Take care.
Hi there,
Why not try asking in Python forum section? Good luck & Take care.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Peter Clark |
last post by:
Think of something like MyYahoo: a personalized portal with news
aggregator, weather forecast, comics, etc. Now instead of visiting a
web site, think of all of it being sent daily as an email. It...
|
by: Rune Hansen |
last post by:
I've posted this question on the mod_python mailing list but didn't get
much response, so I thought I'd post it here.
(My first attempt connected to an unrelated thread..sorry....
|
by: Python_it |
last post by:
I'm going to work with mod_python.
I install mod_python 3.2.2b for python 2.4.
If i test my install with
mptest.py
see this link:...
|
by: neha |
last post by:
hi,
i m trying to integrate python with apache on linux.For this i m using
mod_python.
I dont see any problem with the versions of python,apache and
mod_python i m using.
the versions i m using...
|
by: Tiro |
last post by:
Hi,
I am trying to understand how does .Net Web Service handle requests for
multiple clients simultaneously.
Here is what I am trying to achieve.
I have created a web serive that search...
|
by: RobR |
last post by:
We have a customer using our application that has a problem.
Within our app, we have a two different forms (one generates
an email, the other a fax via a webservice). When they click the
submit...
|
by: yinglcs |
last post by:
Hi,
I am trying to setup Apache with Trac which uses mod_python. I get the
following error:
assert have_pysqlite 0
And I have verify this via command line as well, that seem no
problem....
|
by: Eduardo Dobay |
last post by:
Hello, I've been playing around with mod_python these days (using
Publisher and PSP), and it has been working smoothly under Windows XP
(using Apache 2.2). But when I installed PSE and went to use...
|
by: joe jacob |
last post by:
I configured apache to execute python scripts using mod_python
handler. I followed below mentioned steps to configure apache.
1. In http.conf I added
<Directory...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |