0

If I try to invoke $('#basicForm').submit(); where basicForm is

<form method="post" action="http://127.0.0.1:6789/BasicUploadFile/" id="basicForm"
    enctype="multipart/form-data" target="basicuploader_iframe">
  <div id="basicFilesInputContainer" class="basicInputContainer">
    <div class="mybutton btn-green basicAddButton" id="basicAddButton">Add file(s)</div>
    <input type="file" name="myFiles" size="200" multiple class="basicInputButton" id="basicUploadFile">
  </div>
  <div id="basicUploadFileSubmit">
    <div class="basicSubmitButton mybutton btn-blue" >Upload files</div>
    <input type="submit" id="basicUploadFileSubmitBtn" style="visibility:hidden" >
  </div>
  <input type="reset" class="mybutton btn-red basicDelButton" value="Delete files" name="resetBtn" id="basicUploadFileReset">
</form>

It works fine in every browser (Chrome, Opera, Safari), but in FireFox it doesn't work. Even more it crashes FF!!! Is it FF bug? Thanks.

thecodeparadox
  • 86,271
  • 21
  • 138
  • 164
Nolesh
  • 6,848
  • 12
  • 75
  • 112
  • Where do you invoke it? What does FireBug Console tell's you? – Manuel Rauber Jun 02 '12 at 06:49
  • "Crashes" FF as in, it hangs your browser? What FF version? The problem is hardly related to the single line of code which you showed. – Fabrício Matté Jun 02 '12 at 06:50
  • As much as I can test it, it works for me on FF nightly on Linux. – huon Jun 02 '12 at 06:51
  • FireBug doesn't say anything. As I said FF crashes. I use FF v12.0 – Nolesh Jun 02 '12 at 06:56
  • Sorry guys! I was trying to invoke `$ ('#basicUploadFileSubmitBtn').click();`. Just forgot refresh page. But `$ ('#basicUploadFileSubmitBtn').click();` doesn't work at all! If someone know why I'll appreciate. Thanks – Nolesh Jun 02 '12 at 07:10
  • Firefox 13 beta 6 works for me. It works with `.click()` and `$('#basicUploadFileSubmitBtn').trigger("click");` – Robert Niestroj Jun 02 '12 at 07:20

1 Answers1

2

You may want to check out this related question: Submit a form using jQuery

I think the original way you wrote the question is correct. You should be using:

$("#basicForm").submit(); 

to trigger the submit action.

Alternatively, some more info about what you're submitting could help. It looks like you're trying to test an upload script on your localhost. I found a post here where a user noted that FF 12 seems to upload files more slowly than other browsers: http://support.mozilla.org/en-US/questions/927382

Community
  • 1
  • 1
Mike D
  • 86
  • 3