J
James Storey via JavaKB.com
I have an HTML page that has a form with submit button, that when pressed,
performs an action upon a Java Servlet and fetches back a relevant result.
htmlPage.html
~~~~~~~~~~~~~
....
<form method="POST" action="/ILS/myServlet">
<input type="submit" value="first action" name="option"/>
<input type="submit" value="second action" name="option"/>
</form>
....
myServlet.java
~~~~~~~~~~~~~~
....
String option = request.getParameter("option");
if (option != null) {
if (option.equals("first action"))
firstMethod();
else if
(option.equals("second action"))
secondMethod();
}
---------------------
I would like to "spice up" the style of button by changing the form button
from an input type of "submit, to a type "image":
<input type="image" src="buttons/action1.gif" value="first action"
name="option" size="20"/>
<input type="image" src="buttons/action2.gif" value="second action"
name="option" size="20"/>
However, upon making the changes, when pressing the button, it results in a
blank page. According to references, 'value' is not a valid attribute of
<input type="image>, therefore the form action is not being performed.
Upon trying this in an alternate browser to MSIE, Mozilla works perfectly.
However, I need this to work for MSIE. Does anyone have a solution to this?
performs an action upon a Java Servlet and fetches back a relevant result.
htmlPage.html
~~~~~~~~~~~~~
....
<form method="POST" action="/ILS/myServlet">
<input type="submit" value="first action" name="option"/>
<input type="submit" value="second action" name="option"/>
</form>
....
myServlet.java
~~~~~~~~~~~~~~
....
String option = request.getParameter("option");
if (option != null) {
if (option.equals("first action"))
firstMethod();
else if
(option.equals("second action"))
secondMethod();
}
---------------------
I would like to "spice up" the style of button by changing the form button
from an input type of "submit, to a type "image":
<input type="image" src="buttons/action1.gif" value="first action"
name="option" size="20"/>
<input type="image" src="buttons/action2.gif" value="second action"
name="option" size="20"/>
However, upon making the changes, when pressing the button, it results in a
blank page. According to references, 'value' is not a valid attribute of
<input type="image>, therefore the form action is not being performed.
Upon trying this in an alternate browser to MSIE, Mozilla works perfectly.
However, I need this to work for MSIE. Does anyone have a solution to this?