HTML代码:
<
form
id
=
"formTest"
>
<
select
name
=
"single"
>
<
option
>Single</
option
>
<
option
>Single2</
option
>
</
select
>
<
select
name
=
"multiple"
multiple
=
"multiple"
>
<
option
selected
=
"selected"
>Multiple</
option
>
<
option
>Multiple2</
option
>
<
option
selected
=
"selected"
>Multiple3</
option
>
</
select
>
<
input
type
=
"checkbox"
name
=
"check"
value
=
"check1"
/> check1
<
input
type
=
"checkbox"
name
=
"check"
value
=
"check2"
checked
=
"checked"
/> check2
<
input
type
=
"radio"
name
=
"radio"
value
=
"radio1"
checked
=
"checked"
/> radio1
<
input
type
=
"radio"
name
=
"radio"
value
=
"radio2"
/> radio2
</
form
>
<
input
type
=
"button"
id
=
"submit"
value
=
"提交"
>
JQuery代码:
$(
function
() {
$(
'#submit'
).click(
function
() {
$.ajax({
url:
'你的提交url地址'
,
type:
'post'
,
dataType:
'json'
data: $(
"#formTest"
).serializeArray(),
success:
function
(msg) {
}
});
});
});