Onclick Subroutine problem

Results 1 to 3 of 3

Thread: Onclick Subroutine problem

  1. #1
    bjp Guest

    Default Onclick Subroutine problem

    I cannot get the onclick subroutine call to work. I keep gettting syntax and object expected errors. Can I accomplish what I want to do in VBscript?<BR><BR>What I want to occur is simply this: <BR><BR> I have two submit buttons on a form. 0ne is a Change button and the other is a Delete. The Change button works fine, When the user hits the Delete button, all I want to do is to be able to recognize this fact and go to a different page after submitting the form. The Delete button looks like this:<BR>&#060;Input type = "submit" Value = "Delete" Onclick = "gothere()"&#060;/p&#062;<BR><BR>In my VBScript at the top of the page, I have a subroutine that looks like this:<BR><BR>Sub gothere<BR>var1 = "Delete"<BR>end sub<BR><BR><BR>When I go to the page referenced in the Form = Action, I look to see if the variable var1 contains the value "Delete" and then do a Redirect from there. That&#039s all I want to accomplish.<BR><BR>Why isn&#039t the onclick being recognized? Obviously, I&#039ve missed something here. Really need some help. I&#039m dead in the water.<BR><BR>Thanks in advance.

  2. #2
    Vikram Koneri Guest

    Default RE: Onclick Subroutine problem

    change Onclick = "gothere()" <BR>to <BR> OnSubmit = "gothere() <BR>( dont know if this works )<BR><BR>OR <BR><BR>Change the Button type from Submit to Button and add a line in Gothere() to submit the form <BR><BR>OR<BR><BR>remove the <BR> Onclick = "gothere()" <BR>from the button and add it to the form tag as <BR> OnSubmit = "gothere() <BR><BR>Basically since the button is of Submit type, its onSubmit is called and not the onClick<BR><BR>Hope it solves the problem.<BR>

  3. #3
    BJP Guest

    Default RE: Onclick Subroutine problem

    THanks for your response. I will test this out.

Posting Permissions

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