All pastes #171287 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-09-15 08:29 UTC
rendered paste body

<head>
<?php
$state_list=array("Washington"=>"WA",
                  "California"=>"CA",
                  "Florida"=>"FL);

$Washington_facts=array("National Bird"=>"Seagull",
                        "Temperment"=>"Heavy Rains");

$California_facts=array("State Flower"=>"Poppy",
                        "Agriculture"=>"Oranges");

?>
<script language="javascript">
function JSFunct()
{
// Here I'd like to find the current "changed" value of $state, append it to the word "_facts" so 
// as to be able to access the information in that array to pass onto "info" control on my form

}
</head>
<body>
<form ...>
<table>
<tr><td>
<?php
   $States=array_keys($State_list);

			$vartoecho=0;
			echo "<td><strong>State: </strong>";
			echo "<select name='state' id='state' onChange=\"JSFunct()\">";
		   while(count($State)>$vartoecho){

				echo "\n\t\t\t<option name='st[$State[$vartoecho]]' value='$State[$vartoecho]' ".($state==$State[$vartoecho] ? " selected" : "").">".$State[$vartoecho]."</option>";

				$vartoecho++;
		 }
    echo "</select>";
?>
<textarea id="info"></textarea>
.
.
.