<td colspan="2" align="center"><html:submit onclick= "return validateText()"
styleId="reject" > Reject Version </html:submit></td>
i want to write one more onclick event for this button.
please suggest quickly some good examples.
<td colspan="2" align="center"><html:submit onclick= "return validateText()"
styleId="reject" > Reject Version </html:submit></td>
i want to write one more onclick event for this button.
please suggest quickly some good examples.
Just make the validateText() function call another function. The event will fire once, and you can do what you want at that point. You cannot bind two onclick events on the same button, if that is what you are trying to do.
Put all onclick events inside the validateText().
function validateText(){
onclick_1();
onclick_2();
....
onclick_N();
}
function validateText() {
// Call functionA
// Call functionB
}
functionA() {}
functionB() {}
You could try to add a function encapsulating both calls:
<script>
function myEventHandler() {
if(validateText()) {
theSecondFunction();
return true;
}
return false;
}
</script>
And call it from your button:
<td colspan="2" align="center"><html:submit onclick= "return myEventHandler()"
styleId="reject" > Reject Version </html:submit></td>