www.webdeveloper.com
Results 1 to 2 of 2

Thread: alert on form submission

  1. #1
    Join Date
    Apr 2012
    Posts
    99

    alert on form submission

    I am trying to run code when a form is submitted. Here is my code:

    Code:
    <script type="text/javascript">$(document).ready(function(){$('#fileUpload').submit(function () {
    			alert('ok');});});
    Code:
    <a class="button small red" href="#" onclick="document.forms['fileUpload'].submit();"><span>Submit</span></a >
    The alert seems to work before the function, so the problem seems like I can't get the jQuery function to run when submitting the form.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    did you read this article .submit() ?

    ...Now when the form is submitted, the message is alerted. This happens prior to the actual submission...
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles