F.Joodaki F.Joodaki - 2 months ago 12x
HTML Question

how to submit a form without input submit

I would like to submit a form without a input submit.

I want to submit this form after click on an

tag .

I have a form like this:

<form name="form-form" action="http://localhost/php/enteqal-ax.php" method="post" id="submit_form ">
<input type="hidden" id="value1" name="value_php">

I have an image like this:

<img id="img" width="100px" height="100px" src="http://www.shadyab.com/assests/images/upload/thumb_open-menu-roko-restaurant_(17)3.jpg">

my java script code :

$('#img').click(function() {
var img_src = $('#img').attr('src');

$('#submit_form').submit(); // not works at all



Please remove the space present at the end of your form id like:

id="submit_form "

change it to