How to get value of a input field in Javascript
- by gaurav.mishra280295
I am using valums-file-uploader plugin. It allows me to upload files using ajax. I have a problem with it. I have the following script-
<input type="text" id="Gaurav" name="Gaurav" />
<script src="fileuploader.js" type="text/javascript"></script>
<script>
function createUploader(){
var uploader = new qq.FileUploader({
element: document.getElementById('file'),
action: 'do-nothing.php',
params:{param: document.getElementById('Gaurav').value},
allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
minSizeLimit: 1,
debug: false
});
}
// in your app create uploader as soon as the DOM is ready
// dont wait for the window to load
window.onload = createUploader;
</script>
In it, I want to set the value of param entered by the user. The code is working properly for default value of Gaurav, but didn't work for user inputted value.