用image标签它是不会提交数据的

解决方案 »

  1.   

    同意bitou(大鹏一日同风起,扶摇直上九万里),点击图片是不能提交form的。把图片设为按钮的图片啊!或者设一个隐藏框,点击图片时去触发它提交form
      

  2.   

    當然了,你都沒有提交!
    onclick="buttonAction='register';submit()"
    加submit()不過你的buttonAction='register'?
    這樣你也可以賦值?
    因該是 buttonAction.value = 'register'onclick="buttonAction.value'register';submit()"
    這樣應該可以了吧~不行的話別扔雞蛋,青菜!不要浪費糧食嘛!
      

  3.   

    kkdong你这招好像不行!
    难道使用Struts就不能使用ImageButton么
      

  4.   

    我用Struts+Spring+Hibernate的结构就真的不能用ImageButton了么?
      

  5.   

    button - Render A Button Input Field 
    Renders an HTML <input> element of type button, populated from the specified value or the content of this tag body. This tag is only valid when nested inside a form tag body. If a graphical button is needed (a button with an image), then the image tag is more appropriate
    上面是struts 1.2.7的User and Developer Guides,看样子就是用image实现了,自己在onclick里submit吧
      

  6.   

    可是,即使我写成这样还是不行呀!
    <html:image value="register" property="buttonAction" src="images/register.png"  onclick="buttonAction='register';submit();"/>在Action中取得的buttonAction=null
    再次求助!
      

  7.   

    是不是有别的buttonAction或者buttonAction的赋值方式不对,把buttonAction打出来看看
      

  8.   

    struts中的<html:image src="./../images/register.png" property="buttonAction"></html:image>元素的用法与<html:submit>Submit</html:submit>的用法本质由没有多大区别,<html:image/>元素只是可以让你以图片的方式来submit form中的数据而不是以button的形式来submit form其property属性(可选项)仍对应你的ActionForm中的一个属性,它就像html元素中的<input name="submit" type="image"/>
      

  9.   

    看看这里:
    http://www.blogjava.net/deng947/archive/2006/04/14/41139.html