一.〈html:image〉与〈html:img〉的区别
1.<html:image>具有自动提交功能
2.如果该标签在form里,它就可以自动提交表单,这样就解决了在提交按钮上加图片的问题,屏蔽此功能可以这样写:onclick:"return false"
3.如果只是一般的显示图片可以使用: <html:img>
但是img不能获取表单里面其它数据,如果要获取,就必须通过document.getElementsByName.
Image:
<input id=\""
+ forId
+ "image\" type=\"image\" src=\"../images/common/calendar.png\" width=\"22\" height=\"20\" οnclick=\""
+ "return jscalendarPopUpCalendar(this,this.form.elements['"
+ forId + "'],'" + dateFormat + "','" + birthdayFlg
+ "');\" alt=\"" + buttonValue + "\" />
Img:
<img id=\""
+ forId
+ "image\" src=\"../images/common/calendar.png\" width=\"22\" height=\"20\" οnclick=\""
+ "jscalendarPopUpCalendar(this,document.getElementsByName('"
+ forId + "')[0],'" + dateFormat + "','" + birthdayFlg
+ "');\" alt=\"" + buttonValue + "\" />
jsp画面回车事件自动提交表单,但是如果jsp页面上有html:image时,回去执行html:image的onclick事件。如果换成是img就不会去执行img的onclick事件。
1.<html:image>具有自动提交功能
2.如果该标签在form里,它就可以自动提交表单,这样就解决了在提交按钮上加图片的问题,屏蔽此功能可以这样写:onclick:"return false"
3.如果只是一般的显示图片可以使用: <html:img>
但是img不能获取表单里面其它数据,如果要获取,就必须通过document.getElementsByName.
Image:
<input id=\""
+ forId
+ "image\" type=\"image\" src=\"../images/common/calendar.png\" width=\"22\" height=\"20\" οnclick=\""
+ "return jscalendarPopUpCalendar(this,this.form.elements['"
+ forId + "'],'" + dateFormat + "','" + birthdayFlg
+ "');\" alt=\"" + buttonValue + "\" />
Img:
<img id=\""
+ forId
+ "image\" src=\"../images/common/calendar.png\" width=\"22\" height=\"20\" οnclick=\""
+ "jscalendarPopUpCalendar(this,document.getElementsByName('"
+ forId + "')[0],'" + dateFormat + "','" + birthdayFlg
+ "');\" alt=\"" + buttonValue + "\" />
jsp画面回车事件自动提交表单,但是如果jsp页面上有html:image时,回去执行html:image的onclick事件。如果换成是img就不会去执行img的onclick事件。