<i id='EVGjm'><tr id='EVGjm'><dt id='EVGjm'><q id='EVGjm'><span id='EVGjm'><b id='EVGjm'><form id='EVGjm'><ins id='EVGjm'></ins><ul id='EVGjm'></ul><sub id='EVGjm'></sub></form><legend id='EVGjm'></legend><bdo id='EVGjm'><pre id='EVGjm'><center id='EVGjm'></center></pre></bdo></b><th id='EVGjm'></th></span></q></dt></tr></i><div id='EVGjm'><tfoot id='EVGjm'></tfoot><dl id='EVGjm'><fieldset id='EVGjm'></fieldset></dl></div>
  1. <legend id='EVGjm'><style id='EVGjm'><dir id='EVGjm'><q id='EVGjm'></q></dir></style></legend>

      <small id='EVGjm'></small><noframes id='EVGjm'>

      • <bdo id='EVGjm'></bdo><ul id='EVGjm'></ul>
    1. <tfoot id='EVGjm'></tfoot>

      单选按钮和输入字段

      Radio Button and an Input field(单选按钮和输入字段)
      <legend id='SYo9K'><style id='SYo9K'><dir id='SYo9K'><q id='SYo9K'></q></dir></style></legend>
      • <small id='SYo9K'></small><noframes id='SYo9K'>

        <tfoot id='SYo9K'></tfoot>
        • <bdo id='SYo9K'></bdo><ul id='SYo9K'></ul>

            1. <i id='SYo9K'><tr id='SYo9K'><dt id='SYo9K'><q id='SYo9K'><span id='SYo9K'><b id='SYo9K'><form id='SYo9K'><ins id='SYo9K'></ins><ul id='SYo9K'></ul><sub id='SYo9K'></sub></form><legend id='SYo9K'></legend><bdo id='SYo9K'><pre id='SYo9K'><center id='SYo9K'></center></pre></bdo></b><th id='SYo9K'></th></span></q></dt></tr></i><div id='SYo9K'><tfoot id='SYo9K'></tfoot><dl id='SYo9K'><fieldset id='SYo9K'></fieldset></dl></div>

                  <tbody id='SYo9K'></tbody>
                本文介绍了单选按钮和输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想设置一个表单,用户可以在其中从一组单选按钮中进行选择,如果他们不喜欢任何选择,他们可以使用最后一个单选按钮,该按钮将有一个文本字段,他们可以在其中输入自定义文本.

                I wanna set up a form where users can choose from a set of radio buttons and if they dont like any choice they can use the last radio button which will have a text field to it where they can enter the custom text.

                我在一些网站上看到过这个.只是想知道它是在哪里以及如何实现的

                i have seen this on a few sites. just wondering where and how it was implemented

                推荐答案

                我给你做了个例子,这是你想要的吗?http://www.jsfiddle.net/T7gE7/

                I made you an example, is this what you wanted? http://www.jsfiddle.net/T7gE7/

                var temp = '';
                function disableTxt() {
                    var field = document.getElementById("other");
                    if(field.value != '') {
                        temp = field.value;
                    }
                    field.style.display = "none";
                    field.value = '';
                }
                function enableTxt() {
                    document.getElementById("other").style.display = "inline";
                    document.getElementById("other").value = temp;
                }
                

                这篇关于单选按钮和输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                keeping radio buttons checked after form submit(表单提交后保持选中单选按钮)
                Bootstrap radio button quot;checkedquot; flag(Bootstrap 单选按钮“已选中旗帜)
                Toggle HTML radio button by clicking its label(通过单击标签来切换 HTML 单选按钮)
                Javascript how to change radio button label text?(Javascript如何更改单选按钮标签文本?)
                How can I automatically select specific radio buttons with Greasemonkey?(如何使用 Greasemonkey 自动选择特定的单选按钮?)
                AngularJs. Is it possible to deselect HTML “radio” input by click?(AngularJs.是否可以通过单击取消选择 HTML“收音机输入?)

                <small id='1swaz'></small><noframes id='1swaz'>

                  • <bdo id='1swaz'></bdo><ul id='1swaz'></ul>
                      <tbody id='1swaz'></tbody>

                  • <i id='1swaz'><tr id='1swaz'><dt id='1swaz'><q id='1swaz'><span id='1swaz'><b id='1swaz'><form id='1swaz'><ins id='1swaz'></ins><ul id='1swaz'></ul><sub id='1swaz'></sub></form><legend id='1swaz'></legend><bdo id='1swaz'><pre id='1swaz'><center id='1swaz'></center></pre></bdo></b><th id='1swaz'></th></span></q></dt></tr></i><div id='1swaz'><tfoot id='1swaz'></tfoot><dl id='1swaz'><fieldset id='1swaz'></fieldset></dl></div>

                        <legend id='1swaz'><style id='1swaz'><dir id='1swaz'><q id='1swaz'></q></dir></style></legend>

                        <tfoot id='1swaz'></tfoot>