Calling a Sub from and Input Line

Results 1 to 2 of 2

Thread: Calling a Sub from and Input Line

  1. #1
    Join Date
    Dec 1969

    Default Calling a Sub from and Input Line

    Does anyone know if there is a way to call a Sub from an Input Line for example I would like to do the following:<BR><BR>&#060;Input Name="Test" Value="Test" Action="sub()"&#062;<BR><BR>Sub<BR>Response.Write "You made it to the sub"<BR>End Sub

  2. #2
    Steve Cimino Guest

    Default RE: Calling a Sub from and Input Line

    You need to have an EVENT to call a sub. Also, you need to name the sub something(sub is a keyword, and you shouldn&#039t be able to use it as the name)<BR><BR>It appears to me that you&#039re trying to call an ASP script in the sub. This, you cannot do. Either you made a mistake and forgot the &#060;%%&#062; tags, or you accidentally put Response.Write on the client(invalid on the client side). Separate these two concepts. Think them the same as day and night, and they can&#039t interact with each other.<BR><BR>If you&#039re trying to call a CLIENT side VBSub, you would use:<BR><BR>&#060;INPUT TYPE=BUTTON NAME="yes" ID="yes" LANUGAGE="VBScript" onClick=&#039MySub&#039&#062;<BR><BR>&#060;SCRIPT LANGUAGE=VBSCRIPT&#062;<BR>Sub MySub<BR>msgbox "you are here"<BR>End Sub <BR>&#060;/SCRIPT&#062;<BR><BR>Be forewarned, that this will only work in IE. You should read up on JavaScript, since that is more cross-browser compliant.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts