My question is:
I have a table:
<table>
<tr>
<td>
<form name="intervalForm">
<input type="text" name="interval" value="5"></input>
<input type="submit" value="OK"></input>
</form>
</td>
</tr><tr>
<td>
<form name="intervalForm">
<input type="text" name="interval" value="5"></input>
<input type="submit" value="OK"></input>
</form>
</td>
</tr>
...
</table>
My js(mootools) code:
$('intervalForm').addEvent('submit', function(e) {
new Event(e).stop();
var newRequest = new Request.JSON({
url: 'ajax.php',
onRequest: function() {},
onSuccess: function(r){
if(r.status){
...do action
} else {
...error here
}
}
}).send({data: this});
});
My js code is working for 1st row only. What should I do to make it working for other rows? Thanks.