forms

django ModelMultipleChoiceField (default values)

I`ve been searching and trying to get this to work for the past few hours and I cant ... I have a list of skills that I take from the database forms.ModelMultipleChoiceField( skills.objects.all(), required=True, widget=forms.CheckboxSelectMulti...

How to create password and confirmation when using form_for?

I am using form_for, but I'm not sure how to create the password and password confirmation using the helpers? I have so far: <%= form_for :user, @user, .... do |f| %> <%= f.text_field :user_name, :class .... %> password?? <% end %> Also, when posting to the /user/create action, how to do I prevent certain fields in the model fr...

how to set read only properties to the particular info path form control based on user logged in?

how to set read only properties to the particular info path form control based on user logged in? ...

Why doesn't this javascript focus() work?

I have an index.html which has a huge form in it. The form is submitted by this javascript: byId("p").value = page; byId("nav_container").focus(); document.forms["nav_form_main"].submit(); The focus part doesn't work here... I want the browser to focus on a specific part of the page (almost at top). Any tips of what to do? PS: I ha...

File upload via hidden iFrame - form nesting problem

Hello, I assume this one is rather a JavaScript/jQuery/DOM question than a Rails question, but it's all due to the way I implemented it in Rails. I am trying to upload files while creating a new object (auction). While the user inputs some data, he shall also have the possibility to upload multiple photos. The main problem is, that th...

Nested Model Forms in Rails For a "Quiz"

Hi, I am trying to build a quiz of sorts. I would like my form to be able to build one question with 4 or more answers. 4 answers are inputted by default with the ability to add more answers dynamically with javascript. I have modeled it off the code in Ryan Bate's railscasts "Nested Model Forms". My dilemma comes with setting the ...

An array of nested forms, but I do not want the previous completed objects to show

I have an Object where the object has a nested form of which can be duplicated as needed. To accomplish this I am using : - 2.times { @organization.referrals.build } - form_for @organization do |f| = f.error_messages - f.fields_for :referrals do |qf| = render :partial => 'referral_fields', :locals => {:qf => qf} Now I have tw...

Patterns / strategies for creating a complex nested AJAX / jQuery form

We need to build quite a complicated form, which will allow creation / updating of multiple instances of entity A, where entity A can have multiple instances of entity B. Both types of entities are quite complicated (lots of fields and dropdowns) but only a few of these fields need filling in on creation. The requirement is to be able t...

Is there a JQuery or JS equivalent to PHP's $name = $_GET['name']

I'm trying to figure out a way to read GET method information from a form with javascript. Our IT department has our servers on lockdown, and as the web team we can only use javascript to accomplish our tasks. I'd use PHP if I could, but I can't. What I need to do is read data sent via GET method in js if possible, so that I can assign ...

how to use collection from one form to other

i have collection of classes in one form and i want to use the same collection in other form. so here is the place where the collection is made public partial class Window1 : Window { string text; string[] tmp; double procent; public ObservableCollection<element> elementi = new ObservableCollection<element>(); ...

JQuery check if an option is selected and throw an error

URL: www.Wyler.com Problem: If you go to this site look at the inventory search bar right below the navigation menu. I need a script that throws an error if you try to click the "search" button if "new" and "select dealer" are selected. I tried to do this based on which options had a selected attribute but i'm not sure that attribut...

Making a single create form using Single Table Inheritance in Rails

Hello, I'm using STI in Rails, and I've got a Vehicle object, that has many different types of subclasses, like Car, Truck, etc. It's for a simple app, so STI works fine in this case, but I'm having trouble creating a single form where any type of Vehicle record can be created. Using the following routing: resources :vehicles resource...

AJAX + PHP from with jQtouch and drupal

Im working on a drupal site that uses jQtouch (for iphone), and im trying to make a search that doesnt reload the site. I think the javascript/ajax part isnt working. Im having problems finding out if the data from the php file is actually comming through, at the moment only the js that empties the search-results is working. Apperently j...

Default cursor to search bar on page open

I have recently made a new homepage for my company so that employees can access various cloud services such as fleet trackers etc easily. I also put a google search box on this page so that users would not feel the need to switch back to a search engine for their homepage. I achieved this by using this form. <form method="get" action=...

Submitting an HTML form in Android without WebView

I was given an assignment to develop a very simple weather app in Android using the data given from http://forecast.weather.gov/zipcity.php This would be my first actual android app, my only other experience is watching/reading many tutorials on getting started. To give some background information of the app, it simply needs to have ...

Jquery - Finding Alt Text for Current Image

Using Jquery UI to make a form where when you drag an image to an input, the alt text is parsed as the value of the input. I have this working fine for 1 image but, I want to make it so it pulls for the current image ( so that I dont have to specify the ID's of all of the images ). See the script below: <script> $(function() {...

Jquery change/focus/blur overrides submit in Firefox

A form with a single textfield is given. A submit handler is bound on the form and a change/focus/blur handler bound on the textfield. When something is entered into the textfield and the submit button is then clicked, only the change/focus/blur event is registered in Firefox, while in Safari, both are registered. The form: <form id="...

Correctly instantiating a nested fields_for without showing older saved objects ?

I have a nested form that instantiates as this : - 2.times { @organization.referrals.build } - form_for @organization do |f| = f.error_messages - f.fields_for :referrals do |f| Except, the nested forms are supposed to be always new and unique. Where as this form shows previously created objects as well. So I tried to write as so...

Trouble with adding and removing ExtJS form fields

Hi, I am having a bit of trouble adding/removing fields to/from an ExtJS form. My use case is as follows: Provide a set of radio buttons on the form. Depending on which radio button is selected, show a different set of form fields. I am not all that familiar with ExtJS, but what I am doing is caching the fields that are to be added/rem...

Adding readonly attribute to all form elements

I'm using jQuery to add a readonly attribute to all form elements but can't seem to figure out how to do this. Here is what I'm trying: $('#form1').each( function() { $(this).attr('readonly', true); }); I have a simple form using label/input to display form elements. Also I'm using tipsy (Tool tip plug-in) as well as Formalize (Look ...