-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting params on submitting? #13
Comments
What are you doing in your onstart to access the values that isn't working? Can you paste that code? ~J (via phone)
|
I tried something like $(this).params.data = 'test'; I think I'm just too stupid to access the variables :) |
I can help you find out how to access the right |
Thanks for the help - here's the code: $('input[type="file"]').ajaxfileupload({
|
If you add We're trying to determine if we're even getting the right data, and, ~ J |
Yes, serialize() spits out the expected data when entered in the onStart callback. |
Ok, if anyone has the same problem, here's the solution: I have an ID that can change while the form is present (calling other functions and then replace some id that I need) Changing params onSubmit in the constructor - $('.inputFileField').ajaxfileupload('...') return {'topID':$('#id_master').val()}; Then, in the plugin, look for this: var upload_file = function(){... // let onStart have the option to cancel the upload this changes the topID in the settings and the new value will be transmitted in the _POST-Array Hope that helps someone... |
swissDude - I've tried your approach and I can't get it to work.
and I've changes the plugin to be this:
what am i doing wrong? |
I found out what it is - the function() {return {'filePath':$('#filePathInput').val()};} needs to be in onStart, not onSubmit. |
actually you have to set the parameters as a function . |
usman-arham 's solution worked perfectly. Many thanks! |
Thanks usman-arham, solution worked |
@usman-arham I am using jcrop + AjaxFileUpload + nodejs to achieve a picture cut to the server's demo, O (∩ _ ∩) O Thank you for your answer. perfect |
@usman-arham thank you. You saved me. |
Hi Jordan
First: Thanks a ton for this plugin! It's great!
Except...
I need to pass some form-vars along with the file. But the formvars aren't set, yet, when the instance is initialized.
When I add 'params':{ 'data': $('#myForm').serialize()} I get an empty Element, because the formvars aren't set, yet.
I tried to access the params in the «onStart»-part, but for the life of me, I can't figure out how...
Any ideas?
Thanks a ton!
The text was updated successfully, but these errors were encountered: