Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
刷新jquery移动文本输入_Jquery_Jquery Mobile - Fatal编程技术网

刷新jquery移动文本输入

刷新jquery移动文本输入,jquery,jquery-mobile,Jquery,Jquery Mobile,我已经与JQM合作了几周,在研究了各种示例并阅读了文档之后,我似乎找不到在成功回调中刷新文本输入的方法。这在v1.0b2版中是否可行。我可以刷新(重置)其他元素,但不能刷新文本输入。任何帮助都将不胜感激。谢谢为什么不在文本输入中添加一个类,然后像这样设置这些元素的值: $(".my_class").val(""); 例如: JS HTML 文本输入: 文本区域: 同意以下条款: 我同意 选择宠物: 猫 狗 仓鼠 蜥蜴 我正在代码中动态创建一些文本输入(基于按钮单击)。因为它们是在页面呈

我已经与JQM合作了几周,在研究了各种示例并阅读了文档之后,我似乎找不到在成功回调中刷新文本输入的方法。这在v1.0b2版中是否可行。我可以刷新(重置)其他元素,但不能刷新文本输入。任何帮助都将不胜感激。谢谢

为什么不在文本输入中添加一个类,然后像这样设置这些元素的值:

$(".my_class").val("");
例如:

JS

HTML


文本输入:
文本区域:
同意以下条款:
我同意
选择宠物:
猫
狗
仓鼠
蜥蜴

我正在代码中动态创建一些文本输入(基于按钮单击)。因为它们是在页面呈现之后创建的,所以它们都显示了标准的UI(而不是jquery mobile css外观)。我发现在创建它们之后我必须“刷新”它们(类似于刷新按钮或其他元素的方式)

创建输入后,我添加以下行:

$('#myInputName').textinput();
刷新

<div data-role="page" id="home"> 
    <div data-role="content"> 
        <div data-role="fieldcontain">
            <label for="name">Text Input:</label>
            <input type="text" name="name" id="name" value="" class="resetMe" />
        </div>
        <div data-role="fieldcontain">
            <label for="textarea">Textarea:</label>
            <textarea cols="40" rows="8" name="textarea" id="textarea" class="resetMe"></textarea>
        </div>
        <div data-role="fieldcontain">
            <fieldset data-role="controlgroup">
                <legend>Agree to the terms:</legend>
                <input type="checkbox" name="checkbox-1" id="checkbox-1" />
                <label for="checkbox-1">I agree</label>
            </fieldset>
        </div>
        <div data-role="fieldcontain">
            <fieldset data-role="controlgroup">
                <legend>Choose a pet:</legend>
                <input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" />
                <label for="radio-choice-1">Cat</label>

                <input type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2"  />
                <label for="radio-choice-2">Dog</label>

                <input type="radio" name="radio-choice-1" id="radio-choice-3" value="choice-3"  />
                <label for="radio-choice-3">Hamster</label>

                <input type="radio" name="radio-choice-1" id="radio-choice-4" value="choice-4"  />
                <label for="radio-choice-4">Lizard</label>
            </fieldset>
        </div>
        <a href="#" data-role="button" id="reset">Reset button</a>
    </div>
</div>
$('#myInputName').textinput();