The following code is then supposed to create a simple form allowing the user to select a name from a list and click the "Find" button to go to the appropriate tag.
Everything works as designed except the "find" function - I've spent many hours trying to get the syntax of this right without success. I've tried building the input button code both inside and outside the PHP. Here's the current version:
Expand|Select|Wrap|Line Numbers
- <?php
- echo "<form><label for='user'>Or, find a dog by name:</label>\n
- <select name='findname' id='findname' class='selectOne'>\n
- <option value=''>Select name</option><option value=''>---------------</option>\n";
- sort($dogname);
- foreach ($dogname as $thisdog) {
- echo "<option value='$thisdog'>$thisdog</option>\n";
- }
- echo "</select>\n";
- ?>
- <input type="button" value="Find" onClick='location.href=document.referrer+ "#" + dogname.value';/></form>
Thanks for any help you can give.