CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    VBScript - Click Handler For Button On Form

    On an HTML page, how exactly do I add a click handler for a button on a form? In Java it's

    <INPUT TYPE="submit" NAME="btnSave" VALUE="Save" onClick=OnClickBtnSave>

    I want a subroutine to be called before the form does its POST thing.

    Or, can the form's ACTION be set to call a subroutine instead of going to an URL or script?



    --
    Jason Teagle
    [email protected]

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: VBScript - Click Handler For Button On Form

    this is how I usually do it.

    <form onsubmit="return(myscript());">

    Function myscript
    if document.myform.myfield.value = "" then
    msgbox "fill this field"
    myscript = False ' do NOT submit
    exit function
    end if
    myscript = True ' submit the form
    end function


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured