Form submission - cancel


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Form submission - cancel

  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;">

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center