473,788 Members | 2,744 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 3915
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*******@attgl obal.net
=============== ===
May 15 '07 #2

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

Similar topics

2
2385
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 >" selects the proper panel from a CardLayout). Some of these panels, when selected, perform actions immediately. When that happens, the panel is not displayed until the action is complete. I've tried invalidating the layout and repainting, but it...
1
5980
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 e) { ....
0
1807
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; static Class _mthclass$(String x$0) { try
1
3109
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 the actionlistener should work, and is taken from other functional examples ;however, for some reason the compiler kicks out the following error :/home/vontux/cis435lab1/src/UserInterface.java:103: <identifier> expected btn_roll.addActionListener(...
3
2425
by: shailajaanand | last post by:
can we add Actionlistener to textarea?
3
2795
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 much information, or does it listen all possible events? can you give an example?
1
2261
by: carlos123 | last post by:
if (bathroom.isSelected()){ bathroom is a jcheckbox, why doesnt that work.
4
2873
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? I know I could just use event.getSource and check it all in one big ActionListener, but I've been informed that this is bad pracitce and should be done using inner classes. Just wondering if there were any other ways of achieving this? Thanks,...
7
1704
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 be like a standard calculator on http://calculator.com/ So how do I do this? Here is my source code: /****************************** ** Program Name: Calculator ** ** Date: June 3rd, 2008 ** ** Author: Edward Sanger **...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5403
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.