02.
<select id=
"pagelist"
>
03.
<option value=
""
>กรุณาเลือก</option>
04.
<option value=
"firstOption"
>First</option>
05.
<option value=
"secondOption"
>Second</option>
06.
</select>
07.
08.
<div id=
"firstOption"
style=
"display:none"
>
09.
<form method=
"post"
action=
"first.php"
>
10.
<h2 style=
"color:red"
>First Option</h2>
11.
1:<input type=
"text"
name=
"box1"
/><br />
12.
2:<input type=
"text"
name=
"box2"
/><br />
13.
<input type=
"submit"
/>
14.
</form>
15.
</div>
16.
17.
<div id=
"secondOption"
style=
"display:none"
>
18.
<form method=
"post"
action=
"second.php"
>
19.
<h2 style=
"color:blue"
>Second Option</h2>
20.
1:<input type=
"text"
name=
"box1"
/><br />
21.
2:<input type=
"text"
name=
"box2"
/><br />
22.
<input type=
"submit"
/>
23.
</form>
24.
</div>
25.
<script language=
"javascript"
>
26.
$(
"#pagelist"
).change(
function
(){
27.
var
viewID = $(
"#pagelist option:selected"
).val();
28.
$(
"#pagelist option"
).each(
function
(){
29.
var
hideID = $(this).val();
30.
$(
"#"
+hideID).hide();
31.
});
32.
$(
"#"
+viewID).show();
33.
});
34.
</script>