Click to See Complete Forum and Search --> : Dynamic Script Execution for Data Validation


Vich
07-12-2006, 02:12 PM
I'm talking Server Side scripts - executed from the client.

I want to validate user input against the database (calling a stored procedure) BEFORE submitting the page. The SP would receive a few variables and return an error code.

I'm assuming that I have to execute it from our existing "Validation" JavaScript that is executed when they click "Submit" (just like our current data validation). If there's an error, I set focus to the appropriate field. All that's already in place.

I've heard about, but never used, server side scripting. Where I set up isolated VBScripts in a special directory on the server that are available to the client.

My Question: I'm really looking for links to comprehensive writeups and examples. I did a search here but failed to find them.

Thanks loads: If I can figure this out, my life will become FAR easier.

Security is a concern, but we use a Server Side variable saying they have a valid logon, and validating that is all I'm worried about. I'm assuming they can't create new scripts and these scripts will only be for Order-Input-Data-Validation, nothing critical and no Update-Access. However; any other gotcha-tips on security would be appreciated.

My application: An ASP / VBScript (server side) / JavaScript (client side) / SQL Server (DB back end)
This web app is internet-available (not just intranet), but the users (under 2000 of our dealers) are restricted by signon validation that uses a Session Variable.

Thanks!

gil davis
07-12-2006, 02:35 PM
I don't recall seeing any write-ups on techniques.

However, I have a utility that I wrote for parsing web-page data and then posting it to a database that does some validation. The utility is an html page with a form that posts to an asp page. The asp page looks to see if the data is already on file, and if it is, it displays both the old and the new data for comparison and creates a form with the new data that is different from the old data so that I can decide whether to update the db with it (by another Submit) or reject it (by back button).

If that would be any help, I can post the code for you.

Vich
07-12-2006, 03:28 PM
I don't recall seeing any write-ups on techniques.

However, I have a utility that I wrote for parsing web-page data and then posting it to a database that does some validation. The utility is an html page with a form that posts to an asp page. The asp page looks to see if the data is already on file, and if it is, it displays both the old and the new data for comparison and creates a form with the new data that is different from the old data so that I can decide whether to update the db with it (by another Submit) or reject it (by back button).

If that would be any help, I can post the code for you.Thanks for responding.

I think we do similar techniques to what you describe already. It's intensively data-driven and the same page data is often re-loaded from the database. It's a fairly comprehensive Order Entry and Tracking / Account Receivable, system even with some Inventory capability. In lines of ASP code, it's probably about 50,000 lines.

This is to drive a Warning Pop-Up for sizes (width / height combo).

I have to match the heigth / width grid in the price book that voids our manufacturer's warranty when it's too big, however it's a different grid for each of the 400 or so possible products, and we don't know what product is selected until after the screen is loaded.

I want to call a database procedure from the client side screen validation Javascripts.

Isn't there a thing available in DHTML / ASP environments called "Remote Scripting"?

Thanks much!

Vich
07-12-2006, 04:26 PM
Microsoft reference, click here. (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rmscpt/Html/rmscpt2.asp)

I'm looking for some cookie-cutter examples that are described in http://www.codeproject.com/aspnet/AlvaroRemoteScripting.asp

To quote:
"Remote Scripting offers a better alternative. Instead of the whole page refreshing, a hidden request is made to the server to execute a method which returns back just the data that needs to be changed on the page. The result is a smoother user experience. Indeed, Remote Scripting brings some of the benefits of a traditional fat-client application to a web application.

Back in the days of Visual InterDev 6.0, Microsoft provided client and server-side include files inside its _ScriptLibrary directory. "

Vich
07-13-2006, 01:16 PM
Well, this thread is a little skitsoid ("hello me, how are we doing?" lol), but thank you Gil for the help.

I found one reference like the one I was looking for here. (http://www.developerfusion.co.uk/show/2190/5/). I'm trying it out.

Other comments or references onthis subject are welcomed.