003.
<head>
004.
<title>Select Car</title>
005.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
006.
<link rel=
"stylesheet"
type=
"text/css"
href=
"css/select_style.css"
>
011.
</script>
012.
<script type=
"text/javascript"
>
013.
$(document).ready(
function
(){
014.
015.
$(
"select#typeSub"
).attr(
"disabled"
,
"disabled"
);
016.
$(
"select#carType"
).change(
function
(){
017.
$(
"select#typeSub"
).attr(
"disabled"
,
"disabled"
);
018.
$(
"select#typeSub"
).html(
"<option>wait...</option>"
);
019.
var
carType = $(
"select#carType option:selected"
).attr(
'value'
);
020.
021.
$.post(
"select_type.php"
, {carType:carType},
function
(data){
022.
$(
"select#typeSub"
).removeAttr(
"disabled"
);
023.
$(
"select#typeSub"
).html(data);
024.
});
025.
});
026.
027.
$(
"select#yearStart"
).attr(
"disabled"
,
"disabled"
);
028.
$(
"select#typeSub"
).change(
function
(){
029.
$(
"select#yearStart"
).attr(
"disabled"
,
"disabled"
);
030.
$(
"select#yearStart"
).html(
"<option>wait...</option>"
);
031.
var
typeSub = $(
"select#typeSub option:selected"
).attr(
'value'
);
032.
033.
$.post(
"select_yearStart.php"
, {typeSub:typeSub},
function
(data){
034.
$(
"select#yearStart"
).removeAttr(
"disabled"
);
035.
$(
"select#yearStart"
).html(data);
036.
});
037.
});
038.
039.
$(
"select#yearEnd"
).attr(
"disabled"
,
"disabled"
);
040.
$(
"select#yearStart"
).change(
function
(){
041.
$(
"select#yearEnd"
).attr(
"disabled"
,
"disabled"
);
042.
$(
"select#yearEnd"
).html(
"<option>wait...</option>"
);
043.
var
yearStart = $(
"select#yearStart option:selected"
).attr(
'value'
);
044.
045.
$.post(
"select_yearEnd.php"
, {yearStart:yearStart},
function
(data){
046.
$(
"select#yearEnd"
).removeAttr(
"disabled"
);
047.
$(
"select#yearEnd"
).html(data);
048.
});
049.
});
050.
051.
$.ajax({
052.
type:
"GET"
,
053.
url:
"select_ShowSelectAll.php"
054.
}).done(
function
(data) {
055.
$(
"#result"
).html();
056.
});
057.
058.
function
search(){
059.
var
carType = document.$(
"select#carType option:selected"
).value;
060.
var
typeSub = document.$(
"select#typeSub option:selected"
).value;
061.
var
yearStart = document.$(
"select#yearStart option:selected"
).value;
062.
var
yearEnd = document.$(
"select#yearEnd option:selected"
).value;
063.
alert
064.
$.get(
"select_ShowSelectAll.php"
,
function
(data){
065.
$(
"#result"
).html(data);
066.
});
067.
}
068.
069.
});
070.
071.
072.
</script>
073.
</head>
074.
<body>
075.
<center>
076.
<div id=
"select_box"
>
077.
<?php
078.
include
"select.class.php"
;
079.
?>
080.
<form id=
"select_form"
action=
""
method=
"get"
>
081.
<select id=
"carType"
style=
"width: 235px"
>
082.
<?php
echo
$opt
->ShowMakes(); ?>
083.
</select>
084.
<br />
085.
<select id=
"typeSub"
style=
"width: 235px"
>
086.
<option value=
"0"
>All Model</option>
087.
</select>
088.
<br />
089.
<select id=
"yearStart"
style=
"width: 105px"
>
090.
<option value=
"0"
>All Year</option>
091.
</select>
092.
to
093.
<select id=
"yearEnd"
style=
"width: 105px"
>
094.
<option value=
"0"
>All Year</option>
095.
</select>
096.
<br /><br />
097.
<input type=
"button"
id=
"Search"
value=
"Search"
onClick=
"Search()"
/>
098.
</form>
099.
<br /><br />
100.
<center>
101.
<div id=
"result"
></div>
102.
</center>
103.
</div>
104.
</body>
105.
</html>