How do I use an image as a submit button?

Use an image type input: <input type=”image” src=”https://stackoverflow.com/Button1.jpg” border=”0″ alt=”Submit” /> The full HTML: <form id=’formName’ name=”formName” onsubmit=”redirect();return false;”> <div class=”style7″> <input type=”text” id=’userInput’ name=”userInput” value=””> <input type=”image” name=”submit” src=”https://jekyllcodex.org/uploads/grumpycat.jpg” border=”0″ alt=”Submit” style=”width: 50px;” /> </div> </form>

How to detect submit button clicked in multiple submit buttons scenario in single Action class? [duplicate]

You can define two actions in struts.xml file and use action attribute of <s:submit> tag in order to submit to different actions http://struts.apache.org/docs/submit.html. In JSP: <s:submit value=”Search” action=”searchEmployeeAction”/> <s:submit value=”Add New” action=”addEmployeeAction”/> In struts.xml: <action name=”addEmployeeAction” method=”add” class=”example.EmployeeAction”> <result>/example/add.jsp</result> </action> <action name=”searchEmployeeAction” method=”search” class=”example.EmployeeAction”> <result>/example/search.jsp</result> </action> And in your action create two public String methods … Read more

Multiple submit buttons in an HTML form

I’m just doing the trick of floating the buttons to the right. This way the Prev button is left of the Next button, but the Next comes first in the HTML structure: .f { float: right; } .clr { clear: both; } <form action=”action” method=”get”> <input type=”text” name=”abc”> <div id=”buttons”> <input type=”submit” class=”f” name=”next” value=”Next”> … Read more