Home > php教程 > php手册 > php使用数组填充下拉列表框的方法

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 09:08:13
Original
1051 people have browsed it

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);

}

source:php.cn
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template