Hi,
I have a form that has two inputs of type=image.
Each of these have onClick events that submit the form.
My first image works fine as it is a straigforward submit but the second image should submit the form if a javascript function returns true. Regardless of the return value of my javascript function the form is being submitted.
Response.write "<input alt='Update' type='image' src='tick.gif' onClick='this.form.ipressed.value=" &chr(34) & "Update" &chr(34) & ";if (validateData(document.f1)) this.form.submit();'>"
I have even tried replacing the submit part with an alert window, this works fine, but it still submits the form.
Is it correct for the onclick event of the image to submit the form? If not can anyone shed any light on why it may be doing this.
I have a form that has two inputs of type=image.
Each of these have onClick events that submit the form.
My first image works fine as it is a straigforward submit but the second image should submit the form if a javascript function returns true. Regardless of the return value of my javascript function the form is being submitted.
Response.write "<input alt='Update' type='image' src='tick.gif' onClick='this.form.ipressed.value=" &chr(34) & "Update" &chr(34) & ";if (validateData(document.f1)) this.form.submit();'>"
I have even tried replacing the submit part with an alert window, this works fine, but it still submits the form.
Is it correct for the onclick event of the image to submit the form? If not can anyone shed any light on why it may be doing this.