How can I replace button as link?
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<title>Register</title>
</head>
<body>
<h1>Register</h1>
<div>
<form:form method="post" action="${flowExecutionUrl}" commandName="userForm">
<div style="width:240px">
<div>
<div>First Name:</div>
<div ><form:input path="name"/></div>
开发者_StackOverflow中文版 </div>
<div>
<div>Last Name:</div>
<div ><form:input path="surname"/></div>
</div>
<div>
<div>E-mail:</div>
<div ><input type="text" name="email" /></div>
</div>
<div>
<div>Username:</div>
<div ><input type="text" name="username" /></div>
</div>
<div>
<div>Password:</div>
<div ><input type="password" name="password" /></div>
</div>
<div>
<div>Confirm Password:</div>
<div ><input type="password" name="confirmPassword" /></div>
</div>
<div>
<div>Country:</div>
<div>
<select>
<c:forEach items="${countryList}" var="countryVar">
<option value="${countryVar}">${countryVar}.code</option>
</c:forEach>
</select>
</div>
</div>
<div>
<div>Phone numbers:</div>
<div>
<input name="deleteNumber" type="hidden" id="deleteNumber" />
<c:forEach var="phoneNumber" items="${userForm.phoneNumbers}" varStatus="varStatus">
<form:input path="phoneNumbers[${varStatus.index}]" />
<input type="hidden" name="_eventId_deletePhoneNumber" onclick="document.getElementById('deleteNumber').value = ${varStatus.index};" value="Delete" />
</c:forEach>
</div>
</div>
<div>
<div></div>
<div>
<div>
<input type="submit" name="_eventId_submitRegistration" value="Submit" />
</div>
<div>
<input type="submit" name="_eventId_addPhoneNumber" value="Add phone number" />
</div>
<div>
<div style="padding-left:5px">
<button onclick="window.location='${flowExecutionUrl}&_eventId=cancelRegistration'">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</form:form>
</div>
</body>
</html>
How can replace "_eventId_addPhoneNumber" and '_eventId_deletePhoneNumber" buttons?
Many ways to do it. Easiest way would be to just remove them from your GUI, add link and code the javascript.
精彩评论