I have to submit two forms in a same page. After submitting the first form that record id I need for the 2nd form. That 2nd form contains five file upload fields which should added to the table with foreign key of first form added row id. Can anyone propose how to do this. Thinking of using jquery. But kind of new to jquery. How to get first from submited row id and use it in second form?
Well you can use jQuery submit to change normal submit action, inside this function you can send you data with jQuery ajax, in AJAX success function you can catch the id freshly inserted and use it for you second form submit.
$('#yourFormId').submit(function(e){
e.preventDefault();
$.ajax({
type: "POST",
url: yourUrl,
data : youFormData,
success: function(dataBack){
/* You got your id in dataBack */
});
});