JQuery multiple id index with form submit
- by RussP
Hi folks, not sure how to do this as ID's are ment to be unique but this is a dynamically series of forms generated from a php array - based on reading the file names in a directory - with the same ID. What I need to do is identify which form so the data can be processed.
Here is the form
echo '<form method="post" action="" id="frmwidget">';
echo '<tr>';
echo '<td>';
echo ucfirst($comments[0]);
echo '</td><td>';
echo $comments[1];
echo '</td><td align="center">';
echo '<input type="checkbox">';
echo '</td>';
echo '</td><td align="center">';
echo '<input type="checkbox">';
echo '</td>';
echo '</td><td align="center">';
echo '<input type="checkbox">';
echo '</td>';
echo '</td><td align="center">';
echo '<input type="submit" id="cmdwidgets">';
echo '</td>';
echo '</tr>';
echo '</form>';
And here is my start of the Jquery
$j(document).ready(function() {
$j('#cmdwidgets').live('click',function(){
alert('Your widgets will load');
I will want to Ajax the form in here .. not just an alert
$j('#wall').load("admin/inc/ajax-widgets.php");
return false;
});
});
Yes I know the form could be 1 form not multiples, but for this purpose it needs to be multiple forms. And yes I know the form is incomplete i.e. field names etc.
Any help/suggestions please - thanks in advance