Looking at the following code, I didn't understand the principle at the beginning, because I found that the form below does not have a submit button like input type = "Submit" that we usually call, there is no form in JavaScript. the submit is bound to a click event, so it gets stuck. However, you can submit the form by clicking the submit button of the image ....
IMG can also submit the form:
<form name="uploadForm" enctype="multipart/form-data" method="post" action="/ajax/designer_handler.php?item_id=<?=$item_id?>&tab=<?=$side?>&is_admin=<?=$is_admin?>" onsubmit="return uploadPhoto();" style="display:inline"><input type="hidden" name="MAX_FILE_SIZE" value="25000000" style="display:inline;"><input type="hidden" name="uploading" /><?php $u_agent = $_SERVER['HTTP_USER_AGENT']; $btnText = "Browse";if(preg_match('/Chrome/i',$u_agent) || preg_match('/Safari/i',$u_agent)){$btnText = "Choose File";}$fonts_image_path = FontsImage::getImageUrl($design_id, $side);//var_dump($fonts_image_path);?>Upload up to 5 files at once<br />Click the <?= $btnText?> buttons to select files on your computer:<br /><br /><table cellspacing="5"><tr><td height="25">Photo: <input type="file" id="pathname1" name="pathname1" style="width:300px;" accept="image/jpeg" > </td></tr><tr><td height="25">Photo: <input type="file" id="pathname2" name="pathname2" style="width:300px;" accept="image/jpeg" > </td></tr><tr><td height="25">Photo: <input type="file" id="pathname3" name="pathname3" style="width:300px;" accept="image/jpeg" > </td></tr><tr><td height="25">Photo: <input type="file" id="pathname4" name="pathname4" style="width:300px;" accept="image/jpeg" > </td></tr><tr><td height="25">Photo: <input type="file" id="pathname5" name="pathname5" style="width:300px;" accept="image/jpeg" > </td></tr></table><br /><input id="upload_button" type="image" src="/images/personalize/upload.gif" > <br /><span id="upload_message" style="font-style:italic; color:gray; visibility:hidden">Uploading... (Large pictures may take some time to upload)</span><br /><br /></form>
Originally:
Form Control: input type = "image ")
Input type = image is equivalent to input type = submit. The difference is that input type = image uses an image as the form's submit button. The src attribute indicates the image path.