How to get value of a input field in Javascript
Posted
by
gaurav.mishra280295
on Stack Overflow
See other posts from Stack Overflow
or by gaurav.mishra280295
Published on 2012-07-26T15:19:17Z
Indexed on
2012/10/16
11:02 UTC
Read the original article
Hit count: 351
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.
© Stack Overflow or respective owner