DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    teeny Guest

    Form submission - cancel


    can somebody tell me how to cancel the submission of form?

    thanks,
    teeny

  2. #2
    Michael Guest

    Re: Form submission - cancel


    Teeny,

    Just use a little JavaScript function with a condition to decide whether
    to continue or cancel the form submission. Then on your submit button use
    the onclick event handler to call your function:

    function formHandler(formName)
    {
    if (condition1 == condition2)
    {
    formName.submit;
    }
    else
    {
    return false;
    }
    }

    *button sample
    <input type="submit" onclick="formHandler(document.formName);">

    If your form still submits after being cancelled then add "return false"
    after the semicolon following your event handler.

    Michael

    "teeny" <teeny12@hotmail.com> wrote:
    >
    >can somebody tell me how to cancel the submission of form?
    >
    >thanks,
    >teeny



  3. #3
    qcrsoft Guest

    Re: Form submission - cancel


    <form .... onSubmit="return false;">

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links