开发者

Classic asp radiobutton groups get values

开发者 https://www.devze.com 2023-01-09 18:34 出处:网络
Is there a way to iterate radio groups on a form post to do something with each radio button group? I have a varyin开发者_Go百科g number of radio button sets and need to get values and id\'s out of ea

Is there a way to iterate radio groups on a form post to do something with each radio button group? I have a varyin开发者_Go百科g number of radio button sets and need to get values and id's out of each of them on a postback.


I'm not sure this is what you're looking for, but it might point you in the right direction. If you prefix all names of your radio buttons with "rb" (or some other prefix of your choosing), then the following should give you access to each radio button on a post:

for x = 1 to Request.Form.count() 
    if(Left(Request.Form.key(x),2) = "rb") then
        Response.Write(Request.Form.key(x) & " = " & Request.Form.item(x) & "<br/>") 
    end if
next 
0

精彩评论

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