forms

How can I stop the password field being pre-populated on edit?

I have this problem all the time in my rails apps and I still need the correct solution. Whenever a user edits their own record the password field is being populated. I suspect its Firefox as setting @user.password = nil in the edit action doesn't help. The problem is the password confirmation isn't populated so validation fails due to ...

With nested HTML forms, is it possible to target which one's content is transmitted upon submit?

I have a form within another form: <form id="a"> <form id="b"> <input type="submit"> When the submit button is clicked, it seems that the outer form is submitted. Is there a way to target which form is submitted? ...

How to use jQuery AJAX $.post to store PHP $_SESSION variables?

Help! I'm having trouble wrestling AJAX to work for me. I have a paginated gallery with checkboxes beneath each image and I need to store the checkbox values in session variables if a user moves between the pages, so when they submit the form at any time it will include all checked values across all pages. I'm using this jQuery code: ...

Working with multiple jquery-ui-dialogs

Hi, I have a table with a lot of text inputs like these: (they are marks of tests for a few students). Every field has an associated icon for adding a comment, so when the icon is clicked, a dialog must be shown with a textarea, and then save its value to a hidden input. An example of a mark field: <input class="num" type="text" si...

rails form_remote_tag and onselect submit...

I have a form_remote working perfectly for the form currency. The only change I want to make is the do away with submit button for a select box. So they just click the correct currency and it submits the ajax request. <%= collection_select(:currency, :set, Currency.find(:all, :conditions => 'primary_source = "ECB"'), :code, :pretty_na...

Working with extra fields in an Inline form - save_model, save_formset, can't make sense of the difference..

Suppose I am in the usual situation where there're extra fields in the many2many relationship: class Person(models.Model): name = models.CharField(max_length=128) class Group(models.Model): name = models.CharField(max_length=128) members = models.ManyToManyField(Person, through='Membership') class Membership(models.Model):...

Handling back button

I have a sign-up form that takes several steps. In one of the steps, they fill up some information, and they select some images to upload. The next step, they see a review of their application. What is likely to happen next is that if the user sees something he doesn't like, he will hit the back button to change what's on the form. H...

Complex Model updating in form posting scenarios and MVC

Many people have written about using Automapper to map domain objects (models) to view models, which I find very interesting and useful, but my question is about how to do the opposite. I understand the complexity of this process and why Automapper doesn't work in that scenario but I have to do that a lot with form posting, specially whe...

Is it possible to group $_POST variables?

I have a huge form (for an internal CMS) that is comprised by several sections, some of them are optional some of them are compulsory. All is under an humungous form (it has to be like this, no ajax, no other ways :-( ) Since in a Dilbertesque way everything get changed every second I was wondering if there is any simple way of groupin...

Looping through dynamically build form

Hi, I have created a questionnaire in C# and when the user has entered their responses I want to capture the answers and save to the database. I am building the content in codebehind and putting it into a placeholder on the page. I can get a handle on the placeholder PlaceHolder a = (PlaceHolder)FindControl("PlaceHolder1"); But whe...

How can I avoid iphone safari first letter in caps

Hello, I am designing a small webpage targeted for the iPhone/iPod touch. I have a form that requires the user to enter a code. When you tap on the corresponding field, the iphone will automatically set the first letter to caps. Is there any way to avoid this? I want the whole field to be entered in small caps. Thanks ...

rails multiple form selects

I have a rails form with 2 selects where one of them depends on the the selected value of the other. So if I have 3 users and 5 items per user, once a user is selected I want the items selection to contain only the items specific to that user. Sounds pretty straightforward but I'm having a very difficult time getting this working. Her...

ReCaptcha or Other Captcha on html form

I'm trying to add captcha control to a form which is rendered using xml parser. (XML Parser gets all values from database and creates a include file with form which is appended at bottom of required page) This form makes a http post to a different page when submit button is clicked and then that page validates data and submits data to da...

Can I use a base class method to enable a variety of ui controls in .net?

I need to write a delegate for a worker thread that will handle a wide variety of form controls (buttons, textbox, list...) enable method. I'm thinking they must all be derived from a base class that handles the enable property, but I'm not finding any documentation, nor am I sure how to call the method. ...

Select element: Short and Long names without javascript?

Is there a non-javascript method to allow a <select> element to show short display text when collapsed and longer text when expanded? I came across the "label" attribute for <option> but it is only supported in IE7+. Example: The expanded menu would display: Philosophy 101 Religious Studies 202 Intro to Meditation 303 Mind and its Po...

How To ? Form Post to Multiple Locations

I have a form which I need to POST to multiple scripts. How can I do this the simplest way? I know it could be done with Javascript, Curl or Snoopy class, but really which is the most simplest and best way to do this. One of the scripts sends email and it's a php file, the other is hosted elsewhere. Need to collect data on both script...

Strategies for preserving form data ( on tab/browser close )

I have an issue with a task management application where occasionally users close their browsers/tabs and the information which they type goes away because they accidentally close a browser/tab, resulting in the loss of the text which they've entered ( and some can spend half an hour entering in text ). So I have to provide a solution, ...

Form calculator using Each() and Children() in jQuery

Im trying to build a form that calculates a total price based on a series of drop down boxes with string values such as "This option costs £30" i know this is not ideal but im putting this together as a hack for an existing script For the most part ive got it working however im not sure how to run the each function for each child of #pr...

How do I use inline formsets to link two or more forms?

Hi, I have the following models and I'd like to use them to generate a contact form...now I know I'm suppossed to use inline formsets, but I've never been able to make heads or tails of how to make this work...I want to have the first name, last name, email, phone number, best time to contact, and the message in my view. class BestTi...

change the return of to_param by action? or, terribly broken edit action if perma-url is returned instead of id..

I did some stuff to have to_param return a perma-url so I'd have seo friendly links. Upon creation and update it will generate and return the perma-url in a to_param method that I put in the model. However this causing me some grief in other areas. I have a form that looks like this: <% @apps.each do |app| %> <% fields_for "[id][...