这是我到目前为止所做的:
<label for="popupDatepicker">DOB<span class="red">*</span></label>
<input class="text1" type=text id="popupDatepicker" name="popupDatepicker" maximun=30>
<label for="gender">I am<span class="red">*</span></label>
<select name="gender" id="gender">
<option value="M">Male</option>
<option value="F">Female</option>
</select>
jQuery代码:
$(document).ready(function() {
$("#gender").blur(function() { // when focus out
//$("#message").html(''); //before AJAX response
var form_data = {
action: 'gender',
gender: $(this).val(),
popupDatepicker: $(this).val(),
};
$.ajax({
type: "POST",
url: "functions.php",
data:form_data,
success: function(result) {
$("#genders").html(result);
//alert("Hiiiiiiiiiiiiiiiii");
}
});
});
});
选择性别后,我想同时传递生日和性别。