Tag: forms提交

用引导程序使用Fieldset Legend

我为我的JSP页面使用Bootstrap。 我想为我的表单使用<fieldset>和<legend> 。 这是我的代码。 <fieldset class="scheduler-border"> <legend class="scheduler-border">Start Time</legend> <div class="control-group"> <label class="control-label input-label" for="startTime">Start :</label> <div class="controls bootstrap-timepicker"> <input type="text" class="datetime" type="text" id="startTime" name="startTime" placeholder="Start Time" /> <i class="icon-time"></i> </div> </div> </fieldset> CSS是 fieldset.scheduler-border { border: 1px groove #ddd !important; padding: 0 1.4em 1.4em 1.4em !important; margin: 0 0 1.5em 0 !important; -webkit-box-shadow: 0px […]

jQuery – 从textarea中select所有文本

我怎样才能做到这一点,当你点击一个textarea内,其整个内容被选中? 最后当你再次点击时,取消select它。

如何使用jQuery禁用/启用select字段?

我想创build一个类似的forms的选项 [] I would like to order a [selectbox with pizza] pizza 其中select框仅在checkbox被选中时被启用,而不被选中时被选中。 我拿出这个代码: <form> <input type="checkbox" id="pizza" name="pizza" value="yes"> <label for="pizza"> I would like to order a</label> <select name="pizza_kind"> <option>(choose one)</option> <option value="margaritha">Margaritha</option> <option value="hawai">Hawai</option> </select> pizza. </form> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> </script> <script> var update_pizza = function () { if ($("#pizza").is(":checked")) { $("#pizza_kind").removeAttr("disabled"); } else […]

我怎样才能检查一个表单域使用水豚正确预填?

我有一个适当的标签,我可以用水豚填写没有问题的领域: fill_in 'Your name', with: 'John' 我想在填写之前检查它的价值,并不能弄清楚。 如果我在fill_in之后添加以下行: find_field('Your name').should have_content('John') 该testing失败,虽然之前填写工作,因为我通过保存页面validation。 我错过了什么?

导轨forms的单选button的标签

我的问题类似于这个,但对于Rails应用程序。 我有一个单选button的forms,并希望与他们关联的标签。 label表单助手只需要一个表单域作为参数,但在这种情况下,我有一个单一的表单字段的多个单选button。 我看到做的唯一方法是手动创build一个标签,硬编码为单选button自动生成的ID。 有谁知道有更好的方法来做到这一点? 例如: <% form_for(@message) do |f| %> <%= label :contactmethod %> <%= f.radio_button :contactmethod, 'email', :checked => true %> Email <%= f.radio_button :contactmethod, 'sms' %> SMS <% end %> 这产生了类似于: <label for="message_contactmethod">Contactmethod</label> <input checked="checked" id="message_contactmethod_email" name="message[contactmethod]" value="email" type="radio"> Email <input id="message_contactmethod_sms" name="message[contactmethod]" value="sms" type="radio"> SMS 我想要的是: <input checked="checked" id="message_contactmethod_email" name="message[contactmethod]" value="email" […]

在Chrome开发工具“networking”选项卡中看到的“请求有效内容”与“表单数据”有什么区别

我有一个旧的Web应用程序,我必须支持(我没有写)。 当我填写表格并提交,然后检查Chrome中的“networking”选项卡时,我会看到“请求有效内容”,我通常会看到“表单数据”。 两者之间有什么区别,什么时候发送而不是另一个呢? 谷歌search这个,但没有真正find任何信息解释(只是人们试图让JavaScript应用程序发送“表格数据”,而不是“请求有效载荷”。

如何使用PhantomJS提交表单

我试图使用phantomJS(什么是一个很棒的工具btw!)来提交表单,我有login凭据的页面,然后输出目标页面的内容到标准输出。 我能够访问表单并使用幻影成功设置其值,但我不太确定正确的语法是提交表单并输出后续页面的内容。 我到目前为止是: var page = new WebPage(); var url = phantom.args[0]; page.open(url, function (status) { if (status !== 'success') { console.log('Unable to access network'); } else { console.log(page.evaluate(function () { var arr = document.getElementsByClassName("login-form"); var i; for (i=0; i < arr.length; i++) { if (arr[i].getAttribute('method') == "POST") { arr[i].elements["email"].value="mylogin@somedomain.com"; arr[i].elements["password"].value="mypassword"; // This part doesn't […]

rails simple_form – 隐藏字段 – 创build?

你怎么能有一个简单的forms隐藏领域? 以下代码: = simple_form_for @movie do |f| = f.hidden :title, "some value" = f.button :submit 导致这个错误: undefined method `hidden' for #SimpleForm::FormBuilder:0x000001042b7cd0

如何使用jQuery更改元素的title属性

我有一个表单input元素,并希望更改其标题属性。 这应该很容易,但由于某种原因,我无法find如何做到这一点。 这是如何做的,我该在哪里以及如何寻找如何做到这一点?

为什么textarea充满了神秘的白色空间?

我有一个这样的forms的简单的文本区域 : <textarea style="width:350px; height:80px;" cols="42" rows="5" name="sitelink"> <?php if($siteLink_val) echo $siteLink_val; ?> </textarea> 我不断在这个textarea获得额外的空白空间。 当我插入它时,我的光标就像在textarea的中间,而不是在开始? 什么是解释?