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

Threaded View

  1. #3
    Join Date
    Dec 2004
    Posts
    438

    Re: form submission with Javascript

    For some reason this just doesn't work for me. If I click my button which launches this nothing happens.

    Code:
    function submitForm()
    {
      document.markForm.submit();
    }
    Code:
    <form method="post" name="markForm" id="markForm" action="update_entry.php">
    Code:
    <input type="button" name="submit" value="Update Marks" class="SubmitButton" onClick="submitForm()" />
    I can't see anything wrong with that. My button takes the place of my submit as you can see.

    Edited:
    Eventually found out that I was getting this error in Firefox error console and looked it up:

    "Error: document.markForm.submit is not a function"

    What I found out is the the submit button with the name of "submit" can clash with the submit function. I changed the submit button's name and it worked fine.
    Last edited by Nibinaear; January 31st, 2007 at 04:38 AM.

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