Solved

I need  onchange equivalent of Select Tag in PHP

Posted on 2008-06-24
6
385 Views
Last Modified: 2013-12-13
Hi,

  Can any one find the equivalent PHP code for this html select tag

  <select name="searchlist"  onchange="opt2txt(this)">

  Thanks :)
0
Comment
Question by:balajijoseph
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 2

Accepted Solution

by:
loki23 earned 20 total points
ID: 21855192
Since PHP is a server-side language, and doesn't directly monitor changes on the client-side, there is no PHP equivalent to that statement in PHP. The only way you may incorporate PHP into that statement is to leave it as it is and have the onchange function call an AJAX routine that triggers a php script
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 21857195
There is no "onchange equivalent" code in PHP instead of HTML ... you can rewrite it in php like this,


echo '<select name="searchlist"  onchange="opt2txt(this)">';

Open in new window

0
 
LVL 3

Expert Comment

by:Bivek-jos
ID: 21863194
Hi there,

Yes there is not equivalent code in php for onchange but you can use "AJAX" to call php functions for executing php codes
Google for "ajax"

Thanks
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 21863595
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question