CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Guest

    cancel submit event

    how to cancel submit event after an submit button has been pressed in a html page?


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

    Re: cancel submit event

    return FALSE in the onsubmit event handler for your form object.


  3. #3
    Guest

    Re: cancel submit event

    do u have any sample code for my reference?


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

    Re: cancel submit event

    <FORM onsubmit="return(FormOk());">
    ...
    function FormOk()
    {
    if( everythingIsOk ) {
    return(false);
    }
    else{return(true);}
    }
    (Jscript code)


  5. #5
    Guest

    Re: cancel submit event

    hai lothar..

    i tried it out but doesn't work.... i attach the code below... i'm using VB script...


    function submitSuccess()
    if error then
    submitSuccess = false
    else
    submitSuccess = true
    end if
    end function

    <form onsubmit="submitSuccess()">

    is there anything wrong with my code???




    thanks in advance....



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

    Re: cancel submit event

    yes, there is something wrong with your code.
    you need to write
    <form onsubmit="return(...)"...


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