- Year
- Make
- Model
- Trim
- Comments
Вот мой JQuery:
$(".send").on("click", function(e){
e.preventDefault();
alert("Save Button Clicked");
var TheForm = $(this).closest("form")[0];
//This doesn't work
//var Model = $(this).closest("form")[0].find('input[name="Model"]').val();
//This doesn't work
//var Model = TheForm.find('input[name="Model"]').val();
//This doesn't work
//var Model = TheForm.Model.val();
//This doesn't work
//var Model = $(TheForm).("#SendTo").val();
//This one returns that there is an object, but .val() is undefined
// $(TheForm).children("Model").val();
//This one returns that there is an object, but .val() is undefined
//var Model = $(this).closest("form").children("Model").val();
alert("I need some help with the correct syntax!");
});
Подробнее здесь: https://stackoverflow.com/questions/787 ... orm-button