开发者

how can you combine a form variable and a submit action with one click

开发者 https://www.devze.com 2023-03-16 23:55 出处:网络
I have a form on a website that has a dropdown box and instead of a normal submit button I need to have a button marked yes and one marked no.

I have a form on a website that has a dropdown box and instead of a normal submit button I need to have a button marked yes and one marked no.

So I want to store the value of the dropdown box and keep a note of whether the user pressed yes or no.

Normally I would have a drop down then a radio button for yes/no and then submit but I want to combine the action of clicking yes or no into both storing/passing 开发者_如何学JAVAthe value and submitting the form.

How could I do that? I don't mind some Javascript if necessary.


Only clicked submit buttons will be successful:

<input type="submit" name="foo" value="Yes">
<input type="submit" name="foo" value="No">
0

精彩评论

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

关注公众号