[thelist] help with form validation using ASP/VBScript

Brian Cummiskey Brian at hondaswap.com
Mon Feb 28 15:52:02 CST 2005


Pringle, Ron wrote:

> 
> However, upon submission of the form, I would like to first validate the
> data. I would like to do this within the page the user is on.
> 

Ron, here's an example form and function i use.  this should help you:

<script language="VBscript">
function viewHistory_onClick
   dim valid
   valid = true

	'checking here
     document.parameters.action = "report.asp"
     document.parameters.submit

end function
</script>



<form method="post" name="parameters" action="">
<input id="viewHistory" type="button" value="View Old Reports"  />
</form>



So, basically, you need to assign the id of the input button to the 
function name of the VB script, and call it onClick.  make sense?

This will validate much like a javascript would, on the client.
Keep in mind, this only works in IE/M$ products/browsers.  Firefox and 
the likes will be left with a submit button that doesn't do anything.



More information about the thelist mailing list