Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Processing Forl
Message
 
À
07/12/2000 10:58:22
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, États-Unis
Information générale
Forum:
Internet
Catégorie:
Active Server Page
Titre:
Divers
Thread ID:
00450396
Message ID:
00450438
Vues:
34
Todd;

> I have a form with sevaral objects on it. Such as check boxes. Option Boxes, Select lists, text boxes. Is there an easy way to process this form to my SQL server database using ASP?

The short answer is yes.

Everything is simple when you know how. Where have I heard that before? This is my approach and others I am sure will have a different way to accomplish what I am about to describe.

The simplest approach is to create an ASP form, create an ADO object, Connection and Recordset. On your form you will have objects that are bound to your recordset object. When you click on the Submit command button it will send the form contents to a second form which will process and update the data. The way I do it is to have four forms as follows. One for View/Edit with a form to update data and an Add form with its form to Add new records.

I cannot use the correct symbols so you will have to just try to understand the basic concept.

Now you use the Form Tag with something like this: Action= Method=POST

Form Action=ResponseE.asp Method=Post
Your objects go here.
/form

Action will point to the form you use to save the original forms data which will occur when you select the Submit button.

A better way I feel is to do the following:

Form id=frmFirst name=frmFirst Method=Post
Your objects go here.
/form

script Language=vbScript
Sub cmdSave_OnClick()
‘ Data validation goes here
call frmERBDetail.Submit
location.href = "ERBResponseE.asp?proj_id=" & sEditID & "&Mode=Edit"
End Sub
/script

You can place form level data validation in the save routine and object level data validation can be created using OnBlur().

Something I found most helpful is to use the html maxlength for an input textbox to prevent the user from attempting to enter too much data into a text box. I use ADO to do this and if the size of the data field changes it is automatically adjusted. I do not like to hard code things like that.


I have left out the specifics and have attempted to give you an overall concept of how you might use ASP and SQL Server. Any specific questions?

Tom
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform