Thanks again for the info, wolfing. To try out your code I added the class "classAndDocsFormSubmit'" to the two submit buttons and changed your code to use the correct form name. Here's what I have:
var buttonpressed;
$('.classAndDocsFormSubmit').click(function() {
buttonpressed = $(this).attr('name')
});
$('#addClassAndDocs').submit(function() {
alert('button clicked was ' + buttonpressed)
return(false)
});
Here is the code for the two buttons:
<input type="submit" id="submitAddDocsToClass" name="submitAddDocsToClass" class="classAndDocsFormSubmit" value="Add Checked Documents to Selected Class" />
<input type="submit" id="submitAddClassAndDocs" name="submitAddClassAndDocs" class="classAndDocsFormSubmit" value="Add Class" title="Any documents checked above will be added to the class" />
Each button's click was detected and the alert box showed, but
each of them displayed the same thing: "button clicked was undefined". I tried changing .attr('name') to attr('id') but got the same thing.
____________________________________
f u cn rd ths u cn gt a gd jb n prgrmmng