This topic is locked

User defined actions on list page wit button an vbscript

1/16/2006 9:38:12 AM
ASPRunnerPro General questions
Pfeiffer author

Hello,
I want to implement user actions with button above the list view.

With events it's nearly no problem.
In the function ListonLoad I define the Button and I want to call the vbscript function x_test() if the user

clicks the button. The first commands msgbox are executed properly, but the funtion call to x_test

fails with error "Types incompatible". Does anyone know how to call the vbscript function properly ??

I tried different syntax with x_test(), x_test but all in vain.
The source code is put into xxx_doEvents.asp
Best regards

Uwe Pfeiffer
------------------------------------------------------------------------------------------------------
<%
function x_test()

response.write "hallo"

end Function
Sub ListOnLoad(strSQL)

'** Custom code ****

' put your custom code here

%>

<input type=button value="Test" onclick="vb script:MsgBox 'Hallo':msgbox 'egal':x_test()">

<%

End Sub
%>

Sergey Kornilov admin 1/16/2006

I'm afraid you mixing server-side and client-side code here.
What do you like to do when button is clicked?

Pfeiffer author 1/17/2006

I'm afraid you mixing server-side and client-side code here.

What do you like to do when button is clicked?


Hello,

I was still looking for the possibility to integrate special menus for a user dependent on the actual table and now with events it was easy to do this. My solution I tried first (see above) will not work. I have a better solution found today.
I developed big applications with ASPRUNNER and of course every customer has his own desires.

For example you want to state that some special articles of a table are sold. So I mark some articles and

then have a menu [SOLD] shown above the record list.

If I click on [SOLD] some special vbscript-code is executed to change the

records of the table. You supposed me to use the delete-function but for me it's no good idea.
I used the events to to this. I implemented two functions show_menu() and execute_menu() in the

onload event. These two functions are called with doevents .... in the list page.
Because my functions work with mdelete I at first changed the "normal" delete function a little bit. So delete function will no longer react on the variable mdelete but on action = "delete".
The function show_menu shows the menu and alters foms.delete.....action to a specific value.

The function execute_menu() looks at the value action = "xxxx" and executes then the vbscript.

Then the table view is rebuilt with the new results.
I you are interested I will send my modifications directly to you. Perhaps it's of interest for

you to have some ideas.
I see you are really concerned to solve the problems of ASP-users, so why should I not "support" you. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7560&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

By the way .... Version 4.0 is a very good product !!! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7560&image=2&table=forumreplies' class='bbc_emoticon' alt='B)' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7560&image=3&table=forumreplies' class='bbc_emoticon' alt='B)' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7560&image=4&table=forumreplies' class='bbc_emoticon' alt='B)' />
I you want please contact me Uwe.Pfeiffer@telekom.de. I thinks this discussion should not be a part of

the user forum.
Best regards

Uwe Pfeiffer

Sergey Kornilov admin 1/17/2006

Uwe,
thanks for sharing - this looks as a useful addition. I just do not know how to fit this into existing ASPRunnerPro design.