forms

Validating a radio button is checked with jQuery

帅比萌擦擦* 提交于 2020-01-11 05:30:30
问题 On my form I havea set of radio buttons. Here's the mark up: <div class="optionHolder"> <p class="optionName">Format</p> <div class="option checked"> <input type="radio" name="fileType" value="avi" /> <img src="images/avi.png" alt="" /> <label>AVI</label> </div> <div class="option"> <input type="radio" name="fileType" value="mov" /> <img src="images/mov.png" alt="" /> <label>MOV</label> </div> <div class="option"> <input type="radio" name="fileType" value="mp4" /> <img src="images/mp4.png"

Auto submit form after 5 seconds

本秂侑毒 提交于 2020-01-11 04:30:07
问题 I have a form that i am trying to submit after the page loads and 5 seconds has gone passed.. i have tried setTimeout but it doesnt appear to be working.. can anyone suggest why this would be the case, i have jQuery on the site but couldnt get delay() working either <form action="" name="cartCheckout" id="cartCheckout" method="post"> <input type="hidden" name="action" value="checkout" /> <input type="hidden" name="save" value="1" /> <input type="hidden" name="orderID" value="<?php echo

Process a Form Submit with Multiple Submit Buttons in Javascript

被刻印的时光 ゝ 提交于 2020-01-11 02:49:07
问题 I have a form with multiple submit buttons, and I'd like to capture when any of them are pressed, and perform different JS code for each one. <form id="my-form"> <input type="email" name="email" placeholder="(Your email)" /> <button type="submit" value="button-one">Go - One</button> <button type="submit" value="button-two">Go - Two</button> <button type="submit" value="button-three">Go - Three</button> </form> Looking at an older answer, I can process all of the submit buttons in JS: function

New line in PHP output in a text file

让人想犯罪 __ 提交于 2020-01-11 00:48:07
问题 My php form which saves the output in a text file glues the result to one string like: Name1Email1The Message1Name2Email2The Message2Name3Email3The Message3Name4Email4The Message4 But I need spaces and/or newlines. I normaly don't use PHP so I don't get it. I did't find an answer on the web, also read some Q/A here, but this didn't help me. The Form: <form action="mailer.php?savedata=1" method="post"> Your Name: <input type="text" name="name"><br> Your Email: <input type="text" name="email">

How to obtain form's inner width and height

余生颓废 提交于 2020-01-10 17:44:08
问题 As per title. I am writing a program that all components can adjust size automatically by form's size. When I using this.Width and this.Height properties, its return value is the width and height of whole form (red frame). How to get the form's width and height of its inner area (green frame)? 回答1: Use this.ClientSize.Width and this.ClientSize.Height . http://msdn.microsoft.com/en-us/library/9278sfx2(v=vs.110).aspx 回答2: Yes, You can check by this.ClientSize.Width and this.ClientSize.Height.

Jeditable with jQuery UI Datepicker

那年仲夏 提交于 2020-01-10 14:19:13
问题 I need to have a click to edit element on a page, that will in turn invoke an instance of the jQuery UI Datepicker. Currently, I'm using JEditable to provide the in place editing, which is working fine. However, I have a date control input that I would like to have appear as a calendar, which is where the fun starts. I've found a Comment in the this blog by Calle Kabo (the page is a little mashed unfortunately) that details a way to do this: $.editable.addInputType("datepicker", { element:

Simplest way to disable button on submission of a form?

匆匆过客 提交于 2020-01-10 12:11:52
问题 I've been trying to find the "right" way to prevent double submits of forms. There are lots of related posts on SO but none of them hit the spot for me. Two questions below. Here is my form <form method="POST"> <input type="text" name="q"/> <button class="once-only">Send</button> </form> Here is my first attempt to disable double submits: $(document).ready(function(){ $(".once-only").click(function(){ this.disabled = true; return true; }); }); This is the approach suggested here: Disable

Symfony2 Doctrine2 Many To Many Form not Saving Entities

大城市里の小女人 提交于 2020-01-10 11:58:15
问题 I am having some trouble with a many to many relationship. I have Users and Assets . I would like to be able to assign users to an asset on the asset page. The code below displays a list of users when creating/editing an asset, however changes made to the user checkboxes do not save, while the rest of the data is persisted. If I add an entry to users_assets through the mysql client, these changes are shown in the asset list. User class User extends BaseUser { /** * @ORM\ManyToMany

Symfony2 Doctrine2 Many To Many Form not Saving Entities

只愿长相守 提交于 2020-01-10 11:57:12
问题 I am having some trouble with a many to many relationship. I have Users and Assets . I would like to be able to assign users to an asset on the asset page. The code below displays a list of users when creating/editing an asset, however changes made to the user checkboxes do not save, while the rest of the data is persisted. If I add an entry to users_assets through the mysql client, these changes are shown in the asset list. User class User extends BaseUser { /** * @ORM\ManyToMany

Why to add process=“@this” explicitly to p:commandButton to get action invoked?

我与影子孤独终老i 提交于 2020-01-10 10:35:06
问题 I know that we need to add explicitly process="@this" to get the p:commandbutton action get invoked and I also know that process attribute defaults to @form in primefaces. Since process is defaulted to @form shouldn't the button also get processed along with the other elements in the form and its action should get invoked. Can anyone explain the exact reason behind this? 回答1: Process @form mean the current form of the commandLink/Button Process @this mean the current component of the