All Forums >> [Scripting] >> ASP >> Dynamic call VBScript file in ASP Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Lately I have an web e-form application under construction. As a requirement, there are several eforms require individual form input validation rule set. The form(s) will be posted to a common cgi gateway let say 'request.asp'. Form ID is one of the parameter will be submited to the ASP file, then the ASP file should dynamically call the corresponding VBS file to verify the form inputs, then return response message of validation result if there is any input errors.
I would like to ask, if there is any method to call the VBS files dynamically depends on the Form ID submitted. Each VBS file should have the same validation function (something like the Interface concept in OOP) but have its own implementation of validation/rule set.
My idea is something like that:
<% Dim sResultMsg
If request("form_id") = "FORM001" Then sResultMsg = FORM001.Verify() If sResultMsg <> "" Then Response.Write(sResultMsg) End If End If
If request("form_id") = "FORM002" Then sResultMsg = FORM002.Verify() If sResultMsg <> "" Then Response.Write(sResultMsg) End If End If %>
P.S.: FORM001.vbs, FORM002.vbs...etc are the validation libraries.