开发者

Checkbox groups in asp

I ran into a strange problem with checkbox groups. I am trying to get the values from a group of checkboxes, but I have to hit the submit button twice for it to get the values... I have no idea why. I also use a dropdown box on the same form and I only need to hit the button once to get its value.

my asp code to write it to page

 Dim selectFormValue 
 selectFormValue = Replace(Request.Form("selectTest"), """", "")

 Response.write Request.Form("checkGroup")

here is the html being generated

<form method="post" name="formTest">    
    <select name="selectTest">
      <option value='123"' selected="">Option 1</option>
      <option value='124"' selected="">Option 开发者_如何学JAVA2</option>
      <option value='125"' selected="">Option 3</option>
   </select>

    <input type="checkbox" name="checkGroup" value="1" CHECKED />
    <input type="checkbox" name="checkGroup" value="2" CHECKED />
    <input type="checkbox" name="checkGroup" value="3" CHECKED />
    <input type="checkbox" name="checkGroup" value="4" CHECKED />       
    <input type="submit" name="submit" value="Update" />
</form>

Thanks!


One thing i note is, that you don't specify an action in your form.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜