a sub routine being called from a input button

Results 1 to 3 of 3

Thread: a sub routine being called from a input button

  1. #1
    IsaacH Guest

    Default a sub routine being called from a input button

    I have a piece of code that I put into a subroutine. I want to execute that piece of code when the user click on an input button. How do I get the computer to execute that piece of code when the button is clicked I have an example here.<BR><BR>&#060;%<BR>sub move&#039(direction)<BR><BR>if direction = 1 then <BR>Dim objMoveForward<BR>Dim rsMoveForwardInfo<BR><BR>set objMoveforward = server.CreateObject("Hemisphere.BO")<BR>set rsMoveForwardInfo = objoveForward.NextDomain_RecordInfo (domain_id, statusid)<BR><BR>newdomainid = rsMoveForwardInfo("domain_id")<BR><BR>&#039else if direction = -1 then <BR>&#039code here<BR>&#039else <BR>&#039Response.Redirect("domain_list.asp?status id")<BR>end if<BR>end sub%&#062;<BR><BR><BR>&#060;input type="submit" name="moveforward" value="Move Forward" onclick="move"&#062;<BR><BR>I am going to use the "newdomainid" for something else up in my page but that is something else. I could use any advice you guys can give me.<BR><BR>Thanks in advance!<BR><BR>Isaac <BR> <BR>

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default ASP basics

    you CANNOT call a server side sub in your client side script<BR><BR>let me put this simply<BR><BR>when the server gets a request for a page ALL the server side code gets executed and then the page is sent to the client. So you can then ONLY call client side scripts.<BR><BR>If you want to call anthing in server side you will HAVE TO submit the form again to the server and then run that code. Or if possible call a client side function ONLY. <BR><BR>You can ofcourse access server side values in your client side script but that is as far as you can take it<BR><BR>Your move function is in Server Side...hence you CANNOT access it in your client side

  3. #3
    Isaac Guest

    Default RE: ASP basics

    Akhilesh,<BR><BR>Thanks for the info. How would you suggest that I get the move subroutine to be executed by an action from a user. <BR><BR>The move subroutine is going to allow the user to: update a record in a table and then navigate to a proceding record in a table. <BR><BR>I thank you in advance!<BR><BR>Isaac

Posting Permissions

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