添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
刚毅的围巾  ·  Instance created by ...·  3 周前    · 
会开车的香菇  ·  Training: Health Care ...·  3 周前    · 
沉着的沙滩裤  ·  2.2.2 E-Verify Photo ...·  3 周前    · 
坚韧的跑步鞋  ·  Layui ...·  3 周前    · 
神勇威武的感冒药  ·  Activities - Add ...·  2 周前    · 
玉树临风的荔枝  ·  Getting IO exception ...·  2 月前    · 
健壮的眼镜  ·  SOLVED: OH stops ...·  8 月前    · 
高大的椅子  ·  moment.Moment.isAfter ...·  1 年前    · 

I'm trying to use a div to submit a form. Here's the HTML:

<form name="search-form" 
      id="search-form" 
      action="php.php" 
      class="form-search">
    <input style="color: black; background: rgba(255,255,255,0.5); padding: 15px; font-size: 18px;" 
           type="text" 
           name="search" 
           class="input-medium search-query">
        <div class="button1" onClick="document.forms["search-form"].submit();">
            <a href="#">
                <img  alt="" src="/img/buttons/icon1.png" />
    </form>

The form does not submit when the div is clicked. Could someone point out the problem?
thanks. I've been trying this for an hour at least.

The a href is needed to keep the styling, but even if I remove it and left with just the icon, the submit doesn't work; nor does it work if I apply the onclick to the image.