473,503 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ActionListener for PHP???

Quite a while back I used Java Swing (for Uni project) which allowed the
developer to a create form and on the "Submit" button I recall adding
something called an ActionListener. I was thinking of trying to do the
something similar in PHP but a bit puzzled on how I would achieve it.

My thoughts are to have a class for a Textbox, class for a SubmitButton and
a class called ActionListener which is invoked (is that the correct term??)
when the SubmitButton is pressed. Each instance of the ActionListener class
will have a seperate set of instructions.

Does anyone know of any tutorials online that discuss something like above?
I've looked at a couple of Frameworks and QCodo does something along these
lines.

Cheers

Phil
May 15 '07 #1
1 3891
Phil Latio wrote:
Quite a while back I used Java Swing (for Uni project) which allowed the
developer to a create form and on the "Submit" button I recall adding
something called an ActionListener. I was thinking of trying to do the
something similar in PHP but a bit puzzled on how I would achieve it.

My thoughts are to have a class for a Textbox, class for a SubmitButton and
a class called ActionListener which is invoked (is that the correct term??)
when the SubmitButton is pressed. Each instance of the ActionListener class
will have a seperate set of instructions.

Does anyone know of any tutorials online that discuss something like above?
I've looked at a couple of Frameworks and QCodo does something along these
lines.

Cheers

Phil

Phil,

You don't do it the same way in PHP. Java is much more event-driven
than PHP; it's doing some things behind the scenes that PHP doesn't do
for you.

When the submit button is pressed, a form is submitted to the server.
This includes a request for the page identified in the action= parameter
of your <formelement.

Java will take this request and drive the appropriate listeners for you.
PHP won't. In PHP you get the input via either $_GET or $_POST
(depending on the method= parameter) and handle the request.

It's a little more work for you to do it - but less overhead on the
server (Java calls action listeners for every bean being used, whether
you've overridden it or not).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2373
by: Hal Vaughan | last post by:
I have a "wizard" type program with a series of panels that are placed in a JPanel. When the "Next >" button is pressed, I put in a new panel (in other words, the ActionListener for "Next >"...
1
5953
by: Patrick Vanhoof | last post by:
Hi, I have a small program to test the ActionListener, but it gives errors. Here's part of the code: class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent...
0
1770
by: linux newbie | last post by:
is there any java expert could tell me what the problem below and explain the code to me, your explanation is greatly appreciated :) static Class class$java$awt$event$ActionListener; ...
1
3087
by: cnixuser | last post by:
Hello, I am currently attempting to implement a simple actionlistener for a button in a JFrame that was created via "drag and drop" with the Netbeans 5.0 IDE, the code that I am using to implement...
3
2408
by: shailajaanand | last post by:
can we add Actionlistener to textarea?
3
2778
by: stmfc | last post by:
KeyListener listens keyboard strokes, MouseListener listens mouse events, etc. My question is about ActionListener. what kind of events does ActionListener listen? its name does not give...
1
2245
by: carlos123 | last post by:
if (bathroom.isSelected()){ bathroom is a jcheckbox, why doesnt that work.
4
2858
Stubert
by: Stubert | last post by:
Hi there just a quick question, if I have multiple JMenuItems do I need to create an inner class ActionListener for each and every JMenuItem I create? Or is there a more efficient way of doing it? ...
7
1675
by: Kid Programmer | last post by:
Hey guys. Once again I am making a calculator like I do so much. I ran into an error with this program though. I just couldn't figure out how to make the operators work. I want this calculator to...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.