forms

Partial containing a form appears in both controllers, but fails to submit on one of them

I have a partial that contains a form: <% form_for :message, :url => { :action => "create" }, :html => { :id => 'form' } do |f| %> <%= f.error_messages %> <%= f.label :title, "title" %> <%= f.text_field :title %> <%= f.label :tag, "tag" %> <% if controller.controller_name == "tags" %> <%= f.text_field :tag_list, :value =...

Looking for most efficient way to revert form values to original values on cancel

I have a form with a dynamically-generated group of fields - backend is php/mySQL, and the form is created by reading in data from a table and creating a group of fields for each record. The form has a bit of javascript onSubmit that confirms whether the user really wants to save their changes, but I'm having trouble reverting to the ori...

Linking a new child with its parent when adding a new child.

I have a customer model that has_many events When I go to the customer show page, I have links to all of the events that are owned by customer. I want to add a "New event for this customer" link. Right now, I'm doing that with <%= link_to "New Event for this Customer", new_event_path %> but when I follow that link, I have to manually ent...

read pdf form data using iTextSharp

I am trying to find if it is possible to read PDF Form data (Forms filled in and saved with the form) using iTextSharp. If yes.. please provide some guidance on how. thanks in Advance... Bhuvan ...

Submitting a form through AJAX using CodeIgniter

I am building a web application that will let users follow discussion threads, in Q&A format. To that end, when displaying questions, I have a "Follow" button next to each question. I want users to be able to follow these threads without reloading the page, thus using AJAX. So, I want the AJAX call to: 1) Submit a form updating the d...

How can I define a Listbox to be from the Forms namespace rather than the Control namespace in XAML?

Hi, A potentially ignorant question, but I cant seem to find the answer. My problem is fairly straightforward -- I want to use members of the Forms.Listbox class -- not the Controls.Listbox class. However, both are defined in my code behind. How can I differentiate in XAML? Many thanks. ...

JSON GUI creator/editor

Hi, I'm using text files in JSON format as input to my java/perl programs. I would like to allow novice users to generate such JSON files themselves, following some template. Is there some GUI that allows easy, step-by-step creation of a JSON file? It should allow filling in fields with text, choosing file locations etc. Also note the...

Collecting values from the part-AJAX form with PHP

I currently have a form with a dropdown box, and when the value in the dropdown changes, a PHP file with some more form elements get loaded via jQuery's $.ajax function into the main form. However when I submit the form (using just the non-AJAX way) the values from the 'ajaxed' area of the form are not included in the $_POST values. Do y...

Form generation/validation libraries in Python

I'm a developer in Python coming from a PHP background. In PHP most frameworks included a decent form generation/validation API (Zend and CakePHP come to mind). At my new company we try to stay away from Django and use Werkzeug extensively. I've looked at FormEncode and Formular. Formular seems better to me, but there must be stuff...

Dynamically adding a table row with jquery, then add auto populate select box in each new row

Hey, guys, I tried to ask this yesterday but I didn't explain myself clearly or simply enough. I have a form that is setup in a table. User can add new rows (and more form elements) as they please. Each row of this form needs to have its own separate select box and corresponding subcategory select box. So basically... Name | Select...

How to display number of posts for a given time frame in wordpress

Hello guys, I was hoping to get some ideas as how I can get a number of posts that have been posted on our blog BUT within a certain date range. I know how to get total number but need this extra functionality. This is what I have for getting total number of posts: $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE po...

Two different submit buttons on the same line

I have two submit buttons part of two different forms. They are being displayed on two different lines. Is it possible to have them, side by side on a single line. <form action="" method="POST"> <input type="submit" name = "" value="OK" > </form> <form action="" method="POST"> <input type="submit" na...

django clean_field that references other fields

Hi all, I have a situation where a user can click a check box field, "field_enable", on an html form and a nice jQuery operation will display another field, "fielda", for the user to enter more data in. When "field_enable" is checked, I want to require the user to also fill out "fielda". When "field_enable" is unchecked, the user shoul...

Modifying Drupal Form Fields - [#weight] in array not being respected?

Hello all, I don't have experience in php. I've followed a few tutorials to modify my Drupal forms using the theme method in template.php. For some reason the [#weight] property for a field does not adhere to its values. I'd like to move the Category field [cid] above Subject field [subject]. These are the lines of code I used: $form[...

Using unordered lists to create forms?

This is in continuation to my previous question which was closed cause of similarity to some previous SO questions. Although the answers in all related questions made me to think this: Should we use unordered lists to create forms? And although I got mixed comments. A particular blog http://green-beast.com/blog/?p=259 said that using ...

Building a Form that allows the Browser to Prepopulate with the Username/Email & Password

Hello, Users are complaining about my site, saying that they Sign In form is "not allowing the Firefox and Chrome browsers to "remember password". You should allow people to remember the password in their browser--it will come in handy in the future on future visits." Any ideas why this would be the case? ...

button image as form input submit button?

<form method="post" action="confirm_login_credentials.php"> <table> <tr> <td>User ID:</td> <td><input type="text" id="uid"></td> </tr> <tr> <td>Password:</td> <td><input type="text" id="pass"></td> </tr> <tr> <td colspan="2" align="rig...

How do modern web-apps/sites do postbacks? javascript/ajax, <form> or X?

Hey all. I've tried to Google and research this, but without luck. I am curious to know how "modern" web-apps/sites do postbacks, meaning when they are sending back user-input to the site be processed. Do modern sites still use the old fashion <form>-tags or do they use some sort of javascript/ajax implementation? or is there even a t...

In Rails, I'm trying to pass an attribute to a Model's "new" method, then to the "create method". What's the most efficient way to do this?

In my Rails application I have a Forum with many Topics. From the Forum's, "show" page I have a list of Topics with a link to create a new Topic. My goal is to make sure that when creating the new Topic I have the ID of the Forum when I get to the Topic's "create" method. Right now I'm thinking I'd have to create a hidden field on the To...

jQuery Plugin for multiple line-item forms

I have a form that acts as a frontend to entities in a 1:many relationship. The form lets the user edit the properties for the parent entity, as well as add, edit, and delete properties for the child entities. This is such a common scenario that I expect someone has already come up with an elegant jQuery plugin to help make a user-frien...