I have this jQuery simple code:
<script type="text/javascript">
<!--
jQuery(function(){
jQuery('#old_thumb').click(function(){
$(this).val($(this).attr('title'));
$('#sf').val('2');
$('#add_new_event').submit();
});
});
//-->
</script>
For some reason the submit() is not working (my form doesn’t submit after I click the old_thumb button. Can any one help me?
here is part of the html (its very long and its included php so I will write only the start and those fields which I update )..
<form action="http://dominicbesner.com/wp-admin/admin.php?page=ManageMedia/MM-admin.php&action=Edit2" method="post" name="add_new_event" id="add_new_event" enctype="multipart/form-data">
<input type="hidden" name="sf" id="sf" value="1" />
<input type="button" name="old_thumb" id="old_thumb" value="Edit" title="<?php echo $file;?>'" />
<input type="submit" name="submit" id="submit" value="Save Medias" class="button-primary" />
<input type="reset" name="reset" value="Reset Form" class="button" /></td>
</form>
You seem to be mixing your jQuery instance references – you’re using
jQueryand$. Assuming you’ve setnoConflicttry this: