how to set value for <html:img>
i am using <html:img tag to render image and i need to set some value to that image when selected and that value need to be checked in java code.How i can set the value for that image.Thanks,>
# 1
Value for an image?Do you mean a checkbox?Create a form with input type checkbox, give that a name plus the value that identifies the image. (this is all html)Check the request parameter in java for that name to retrieve the value in Java.
# 2
use javascript and hidden input to do this:
<html:img src="your_img.gif"ononclick="document.getElementById('your_hidden_input_id').value='your_value' ">
<input type="hidden" name="your_hidden_input_name" id = "your_hidden_input_id" value="" />
Hope that Helps