У меня есть форма с одним атрибутом, и я хочу отправить форму при изменении значения только атрибута, но так или иначе событие изменения не срабатывает. вот мой кодform submit при изменении значения поля ввода
function triggerClick(){
\t $('#user_profilepic').trigger('click');
};
$('#user_profilepic').change(function(){
\t $('form#updateAvatar').submit();
});
#updateAvatar{
display: none;
}
<form id="updateAvatar" class="simple_form edit_user" method="post" accept-charset="UTF-8" action="/edit/updateAvatar" enctype="multipart/form-data" novalidate="novalidate">
<div class="form-group file optional user_profilepic">
<label class="file optional control-label" for="user_profilepic">Profilepic</label>
<input id="user_profilepic" class="file optional" type="file" name="user[profilepic]">
</div>
<input type="submit" value="Update User" name="commit">
</form>
заранее спасибо
Поделитесь своими html, Fiddle будет лучше. – Farhan
Я наклеил свой html-код выше – Mr94