Hello. I have been racking my brain, as well as this forum, trying to find a way to dynamically show records from one table in a 2nd select list when a particular option is chosen in the 1st select list, and records from a different table if a different option is chosen.
I would prefer to do this without using Javascript, but will if I must.
My original thoughts are along the lines of:
(all this is already in a PHP echo statement, and the form name is "addanimal")
<select name=statusAvailable>
<option selected>--Choose Animal Status--</option>
<option value='Available'>Available</option
<option value='Adopted'>Adopted</option>
... (there are more options, but the two above are the critical ones) ...
</select>
Here's where I get lost...my thoughts are:
"; //ending echo
if (document.addanimal.statusAvailable.value=="Available"){
pull information for a second dropdown, which I have working fine.}
elseif (document.addanimal.statusAvailable.value=="Adopted"){
pull information for a second dropdown, which I have working fine.}
else {""}
My main concern is I want a list of fosters to choose from if the animal is available for adoption. I want a list of adopters to choose from if the animal has been adopted. I would prefer not to have both options shown on screen as it may be confusing for the end user.
Any help is greatly appreciated. I know the if statements are using (incorrect i'm sure) javascript code, but if possible, I'd like that to be PHP, or at least the correct Javascript code.
Thanks!
Rebecca