Home  >  Article  >  Backend Development  >  php使用数组填充下拉列表框的方法_PHP教程

php使用数组填充下拉列表框的方法_PHP教程

WBOY
WBOYOriginal
2016-07-13 09:58:351010browse

php使用数组填充下拉列表框的方法

 本文实例讲述了php使用数组填充下拉列表框的方法。分享给大家供大家参考。具体实现方法如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

$data = array(

(object)array("titulo"=>"Ford", "valor"=>"opcion1"),

(object)array("titulo"=>"Peugeot", "valor"=>"opcion2"),

(object)array("titulo"=>"Chevrolet", "valor"=>"opcion3"),

(object)array("titulo"=>"Volskwagen", "valor"=>"opcion4"),

);

?>

<script></script>

function onCambioDeOpcion(combobox) {

alert("Seleccionaste: " + combobox[combobox.selectedIndex].text +

" \nSu valor es: " + combobox.value);

}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/977161.htmlTechArticlephp使用数组填充下拉列表框的方法 本文实例讲述了php使用数组填充下拉列表框的方法。分享给大家供大家参考。具体实现方法如下: 1 2...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn