When you call the function - send the tag object to it:
<input type="image" name="img_1" onClick="validate(this)">
Then you just need to change the validate function to incorporate this information.
sample:
function validate(){
var name = (arguments[0])?arguments[0].name:null;
//...rest of validate functon
}
}
The reason I did this is so that the argument is optional, just in case you can't go back and change all the calls to it - or only sometimes you want to include the name.
Also it relies on the input having a (unique) name.
You may have to modify whatever is in the rest of the function to cope with the case where name =null, unless you are always going to send the object to the method.
Of course this entails modifying all the method calls, I don't think there is any Event.getSource() - not that I can find. ;-)
b2 - benbiddington@surf4nix.com