|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using procedures in ASP
Please be patient guys, I am new to ASP programming but I assure you that I am a fast learner.
Ok, If I need to use a procedure call when clicking on a form button of an "ASP" page instead of submitting the form. <Input type="Button" name="btnInsert" value="Insert" OnClick="btnInsert_Click()"> <% Sub btnInsert_Click() ' I need to open a table and insert the data I collected in a form EndSub %> When clicking I received an error "Object Expected". What is wrong in the code. Should I inclose the btnInsert_Click() within the <Script> tag? Thanks Thanks |
|
#2
|
|||
|
|||
|
There are two forms of functions/subroutines. Server side, which is normally used with VBScript, and client side, which is normally used with Javascript.
When using the onClick property of a HTML tag, you are trying to activate a client side function, and therefore needs to be defined between the <script> tags. You can also use VBScript as a client side scripting, however, this only works with IE and not other browsers. The better method of achieving what you want is to have the action of the form post to another asp page. This asp web page retrieves the fields passed to it, and then updates the database table. I hope this helps Darrell |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Using procedures in ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|