For some reason, I cannot seem to get the value from my inputs. I am using type=image on all of them in my form.
What I would like is to serialize the data and send it to my back end code. Can someone please show me how this should work? I don’t know what I’m doing wrong here.
<form id="test">
<input type="image" src="test.jpg" alt="test 1" id="test1" name="test1" />
</form>
var values = $('#test input').serialize();
var request = $.ajax({
url: "test.php",
type: "POST",
data: values,
dataType: "json"
You need to use val()
Your statment would be,