I have a hidden input:
<input class="hidden" id="imageInput" type="file" accept="image/*;capture=camera" />
The way this happens is a click that has a label that calls this function:
<label onclick="verifyValue(); return false;" class="hand-pointer">Click me!</label>
And my function verifyValue()looks like this:
function verifyValue() {
app.ajax({
type: "POST",
dataType: 'json',
url: myUrl + '/DoSomeVerification',
contentType: 'application/json; charset=utf-8',
cache: false,
data: JSON.stringify(myData),
success: function (result) {
$('#imageInput').click();
}
error: {
}
});
}
My problem is that it $('#imageInput').click();does not work. When I debug this, it does it on this line and then does absolutely nothing. I have no errors, no dialog box to download the file or anything else.
To verify that this is not some other aspect of my code, I got rid of the AJAX post and simplified this function to the click event. When I get rid of the AJAX post, it works like a charm.
Also, if I do something like this instead .click():
$('#pickTicketImageUpload').removeClass('hidden');
Choose File .
, - , - , . - , ?
, , , , - , AJAX.