html 图像提交

<input type="image" > 即使用图像作为按钮进行form的提交 

示例 1 : 

使用图像进行提交

设置src属性

<form action="/study/login.jsp">
账号:<input type="text" name="name"> <br/>
密码:<input type="password" name="password" > <br/>
<input type="image" src="https://how2j.cn/example.gif">
</form>

 

 示例 2 : 

login.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
     
<%
    request.setCharacterEncoding("UTF-8");
    String name = request.getParameter("name");
    String password = request.getParameter("password");
     
%>
 
您提交的账号名是 :<%=name%> <br/>
您提交的密码是 :<%=password%>
<br>
<a href="javascript:history.back()">返回</a>
原文地址:https://www.cnblogs.com/JasperZhao/p/13186187.html