Click to See Complete Forum and Search --> : VBScript - Click Handler For Button On Form


Jason Teagle
February 21st, 2000, 06:23 AM
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?

Lothar Haensler
February 21st, 2000, 06:50 AM
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