#EANF#
I'm trying to add another parameter using a hidden input:
$('#form1').submit(function(){ //listen for submit event
$('<input />').attr('type', 'hidden')
.attr('name', id)
.attr('value', id)
.appendTo('#form1');
return true;
});
My HTML form:
<form id="form1" method=POST runat="server" enctype='multipart/form-data'
action="/set_image">
<div class="fileButtons">
<input type='file' id="imgInp" name="imgInp" accept="image/*"/>
<input type='button' id='remove' name="remove" value='Remove' />
</div>
<br>
<div class="modal-footer">
<a type="button" class="btn pull-left"
data-dismiss="modal">Cancel</a>
<button type="submit" class="btn btn-primary pull-left">OK</button>
</div>
</form>
The function jumps to "return true" without doing anything.
I used the post in here:
http://stackoverflow.com/a/993897/2653179
No comments:
Post a Comment