Skip to content
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

Not sure how to change a param #41

Open
smashmirrorcardboardface opened this issue Jul 14, 2014 · 1 comment
Open

Not sure how to change a param #41

smashmirrorcardboardface opened this issue Jul 14, 2014 · 1 comment

Comments

@smashmirrorcardboardface

Hi, I'm using your great ajax file upload code like this:
$(document).ready(function(){
$('#fileSelector').ajaxfileupload({
'action': 'UploadFile',
'params':{
'filePath':$('#filePathInput').val()
},
'onComplete': function(response) {
$('#infoDiv').html("File Uploaded").fadeOut(5000);
},
'onStart': function() {
$('#infoDiv').html("Uploading").show();
}
});
});

I want to be able to change the filePath param and use whatever is the value of that input field when the ajaxfileupload function is fired.

with the code as it is at the moment it only uses the value of the input field at page load.

any ideas how to implement what i need??

@smashmirrorcardboardface
Copy link
Author

Here is the HTML oin the page:

<script src="js/jquery/jquery.ajaxfileupload.js"></script>
<script language="Javascript">
var filePath = $('#filePathInput').val();
$(document).ready(function(){
    $('#fileSelector').ajaxfileupload({
       'action': 'UploadFile',
       'params':{
           'filePath':$('#filePathInput').val()
           },
       'onComplete': function(response) {         
         $('#infoDiv').html("File Uploaded").fadeOut(5000);
       },
       'onStart': function() {
         $('#infoDiv').html("Uploading").show();
       }
    });
});

</script>
</head>
<body>
<form>
<div>                                 
 <div id="fileInputDiv" style="font-size:11px; font-family:'Trebuchet MS', Helvetica, sans-serif">Upload New Report Version - <br /><input type="file" id="fileSelector" name="datafile" /></div>   
 <div id="infoDiv" style="font-size:11px; font-family:'Trebuchet MS', Helvetica, sans-serif"></div>
 <input id="filePathInput" />
</div>
</form>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant