onChange to a php function

A

Anonymous

Guest
:sad:

Is it possible to do something like this:

<?php

echo "<form action=\"show.php\" method=\"post\">\n";
echo "<select name=\"pair1\" onChange=\"*DO PHP FUNCTION*\">\n";
echo "<option value=\"\" SELECTED>blah</option>\n";

?>

:(

If so, please tell me how. How would I point the onChange to the php code?

Thanks.
 
As Java is Client side, and PHP server side, this idea is not possible UNLESS you get the page to perhaps refresh and run the function you require...

Andrew
 
shortty said:
:sad:

Is it possible to do something like this:

<?php

echo "<form action="show.php" method="post">\n";
echo "<select name="pair1" onChange="*DO PHP FUNCTION*">\n";
echo "<option value="" SELECTED>blah</option>\n";

?>

:(

If so, please tell me how. How would I point the onChange to the php code?

Thanks.

on the onchange event you call a javascript finction
which submits the form

eg...
Code:
function onchagenfn() {
  document.forms['formname'].submit();
}
 
Back
Top