Link to home
Start Free TrialLog in
Avatar of Panos
PanosFlag for Germany

asked on

Jquery.form plugin submit onchange - problem

Hello experts.
I want to use jquery.form plugin.
The problem i have is that i need to fire the ajax - submit on file select but i can't.
Here is my code
$(document).ready(function () {
 $("#instruc").on("change", ".filefield", function (e) {
     e.preventDefault();
     var myform = $(this).parent('form');
     $(myform).ajaxForm({
        dataType: 'json',
        url: 'myactionpage.cfc',
        beforeSubmit: validate,
        beforeSend: function () {},
        uploadProgress: function (event, position, total, percentComplete) {},
        complete: function (response) {}
    }, "json");
  }
 )
});

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ishaan Rawat
Ishaan Rawat
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panos

ASKER

Hi.
None of the two is working. I changed
$(myform).ajaxForm({
to
$(myform).ajaxSubmit({

Now it is working. I don't know what the differences between ajaxForm and ajaxSubmit are
oo man its a big difference...

you should have specified...
Avatar of Panos

ASKER

I have the same code without the on change event ( it is working submiting the form with a button). It is working with ajaxForm.  In this case it is not.