如何提交下拉列表更改的表单? [英] How to submit form on change of dropdown list?

查看:93
本文介绍了如何提交下拉列表更改的表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在JSP中创建了一个页面,我有一个下拉列表,一旦用户选择了一个值,他必须单击go按钮,然后将值发送到Servlet。

I am creating a page in JSP where I have a dropdown list and once the user selects a value he has to click on the go button and then the value is sent to the Servlet.

            </select>
            <input type="submit" name="GO" value="Go"/>

我该怎么做才能在变化时做到这一点?例如。当用户选择约翰时,他所有的细节都从数据库中恢复并显示出来。我希望系统能够做到这一点,而不必点击go按钮。

How do I make it so that it does it on change? E.g. when the user selects John all his details are retrived from the DB and displayed. I want the system to do it without having to click the go button.

推荐答案

只需要JavaScript帮助。

Just ask assistance of JavaScript.

<select onchange="this.form.submit()">
    ...
</select>



另请参阅:




  • HTML狗 - JavaScript教程

  • See also:

    • HTML dog - JavaScript tutorial
    • 这篇关于如何提交下拉列表更改的表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆