I have a page which dynamically creates multiple forms, each form had a unique “id”
Within each form is one hidden input field always with the same”id” and “name”
What I am wanting to do is with each form to be able to do an ajax(post) call, which I can do, my issue is getting the input field value from the from ..
So I can get the
$(document).ready(function() {
var n = $("form").size();
alert('there are ' + n + ' forms');
$('form').submit(function(event){
event.preventDefault();
var formName = $(this).attr('id');
alert(formName);
});
});
So what I amnting to do is to get the value of the input field in the form that has been triggered, the id is held in the var formName
I have been stabbing away but getting no-where fast…
Thanks
Simon
Put your hidden element ID into the find(). And make .ajax() with passing hiddenValue to data.