Duplicate - see below
Printable View
Duplicate - see below
I have taken the liberty of developing your code:
I removed #IDTST for # in the Links.Code:<script>
function myFunction(id){
alert(id);
}
var h = document.getElementsByClassName("formButton");
for (var i=0;i<h.length;i++) {
h[i].parentElement.setAttribute('href',"javascript:myFunction('"+h[i].id+"');");
}
</script>
I added htmlclass=formButton to the button Names.
@naz - the code in in the Page's Body.
You would change myFunction() to validate_forms().
Acorn
Cool, I did not know the htmlclass name. There is always something to learn here...