Ajax file upload with remote_form_tag

when I tried below, it worked

I could receive the file at server end through params[:charts_file].

Now i wanted to have it ajax so I just added the ‘onSubmit’ like below,
and it didnt work …

one correction to above

please read following occurrence

<input type=“button” name=“submit” class=“button_light” value=“Upload”

as

<input type=“submit” name=“submit” class=“button_light” value=“Upload”

thanks