Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Array ( [0] => stdClass Object ( [stateId] => s1 [stateName] => Kuala Lumpur)
  2. [1] => stdClass Object ( [stateId] => s2 [stateName] => Selangor))
  3.  
  4. <html>
  5. <head></head>
  6.  
  7. <body>
  8. <form action="test3.php" method="post">
  9. State:
  10. <select name="state" id="state" onchange="showCity(this, 'city')">
  11. <option value ="">select one</option>
  12. <?php
  13. for($i = 0; $i < count($stateJsonObject); $i++)
  14. {
  15. echo '<option value = '.$stateJsonObject[$i] -> stateId.'>';
  16. echo $stateJsonObject[$i] -> stateName;
  17. echo '</option>';
  18. }
  19. ?>
  20. </select>
  21. <input type="submit" name="submit" value="Submit" />
  22. </form>
  23. </body>
  24. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement