fmrock
04-13-2009, 06:54 PM
I used to have a function call on a regular submit button, but changed it to a image type, but the call does not appear to work anymore.
It just seems to submit right though when it should not.
<input type="image" name="No Addendum Required" class="Addendum_btn" src="images/buttons/no_addendum_required.png" alt="No Addendum" width="100" height="100" border="0" onClick="return validateNoAddendumRequired()">
here is the JS function
function validateNoAddendumRequired() {
var ta = frmAddendum.elements["Addendum"];
clearComments(document.frmAddendum.Addendum);
if (!ta.value.length) {
//alert("You must enter your text or choose No Addendum Required.");
return true;
}
else
{
return (confirm("You have chosen to enter a comment. This will not become part of the medical record."));
}
}
Here is the previous button code.
<input name="btnSubmit" type="submit" id="btnSubmit" class="button" value="No Addendum Required" onClick="return validateNoAddendumRequired()">
It just seems to submit right though when it should not.
<input type="image" name="No Addendum Required" class="Addendum_btn" src="images/buttons/no_addendum_required.png" alt="No Addendum" width="100" height="100" border="0" onClick="return validateNoAddendumRequired()">
here is the JS function
function validateNoAddendumRequired() {
var ta = frmAddendum.elements["Addendum"];
clearComments(document.frmAddendum.Addendum);
if (!ta.value.length) {
//alert("You must enter your text or choose No Addendum Required.");
return true;
}
else
{
return (confirm("You have chosen to enter a comment. This will not become part of the medical record."));
}
}
Here is the previous button code.
<input name="btnSubmit" type="submit" id="btnSubmit" class="button" value="No Addendum Required" onClick="return validateNoAddendumRequired()">