VBScript - Click Handler For Button On Form
On an HTML page, how exactly do I add a click handler for a button on a form? In Java it's
<INPUT TYPE="submit" NAME="btnSave" VALUE="Save" onClick=OnClickBtnSave>
I want a subroutine to be called before the form does its POST thing.
Or, can the form's ACTION be set to call a subroutine instead of going to an URL or script?
Re: VBScript - Click Handler For Button On Form
this is how I usually do it.
<form onsubmit="return(myscript());">
Function myscript
if document.myform.myfield.value = "" then
msgbox "fill this field"
myscript = False ' do NOT submit
exit function
end if
myscript = True ' submit the form
end function