• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

I need onchange equivalent of Select Tag in PHP

Hi,

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

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

  Thanks :)
0
balajijoseph
Asked:
balajijoseph
  • 2
1 Solution
 
loki23Commented:
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
 
Loganathan NatarajanLAMP DeveloperCommented:
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
 
Bivek-josCommented:
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
 
Loganathan NatarajanLAMP DeveloperCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now