forms

IIS Virtual Directory/Application & Forms authentication

I've setup and deployed a simple forms authentication website with membership using .NET 4. I've created a virtual directory (now converted to "Application") in IIS7 and setup the web.config file in the virtual directory as follows: <configuration> <system.web> <authorization> <deny users="?"> </authoriz...

problem with Chrome form handling: input onfocus="this.select()"

I'm using the following HTML code to autoselect some text in a form field when a user clicks on the field: input onfocus="this.select()" type="text" value="Search" This works fine in Firefox and Internet Explorer (the purpose being to use the default text to describe the field to the user, but highlight it so that on click they can j...

Custom login in Django

Django newbie here. I wrote simplified login form which takes email and password. It works great if both email and password are supplied, but if either is missing i get KeyError exception. According to django documentation this should never happen: By default, each Field class assumes the value is required, so if you pass an empty v...

How can I organize many results in a selectbox using php?

I have a select box that is part of a form. It is currently querying the addresses table and displaying the addresses into the select box. I plan on having up to 100 addresses. I'm looking for a solution where I can show all the states if the user clicks on the select box. Then if the user hovers over a state it will show all the addres...

Form not sending full data

I have a form with over 50 input fields. The input fields are divided into 5 jquery jabs within the form container. Here's a sample of what it looks like: <form action="admin/save" method="post" enctype="multipart/form-data"> <input type="hidden" name="type" value="department" /> <input type="hidden" name="id" value="21" /> ...

Rails - Create form fields dynamically and save them

I'm building an ad-system where users can dynamically create 'fields' for each ad type. My models and example values: AdType: | id | name |----|----- | 1 | Hotel | 2 | Apartment AdOption: | id | ad_type_id | name |----|------------|----- | 1 | 1 | Star rating | 2 | 1 | Breakfast included? | 3 ...

Adding fields to Django form dynamically (and cleanly)

Hey guys, I know this question has been brought up numerous times, but I'm not quite getting the full implementation. As you can see below, I've got a form that I can dynamically tell how many rows to create. How can I create an "Add Row" link that tells the view how many rows to create? I would really like to do it without augmenting th...

ASP.NET MVC 2 Post AJAX from from JavaScript

Hi, I got control with strongly typed View, with Ajax.BeginForm(). Now I would like to change submit method from <input type="submit" id="testClick" value="Submit" /> To some javascript method DoSubmit(). What I tried is : Invoke click on that submit button Invoke submit on form ('form1').submit(), document.forms['form1'].submit...

Using a Windows 7 style menustrip in Windows Forms

I am using windows forms and when I use a MenuStrip item, I get something that looks like this: http://imgkk.com/i/ggn1.png Is it possible to use menu strips like the ones the system uses, like in Windows Explorer, or Firefox, for example: http://imgkk.com/i/cxyg.png with Windows Forms, or C# in general? ...

What is the reason to use observe_field instead of onkeydown in rails?

Is there any good reason why most rails developers use observe_field when they want trigger specific action when text input box is changed, rather then using onkeydown? I would expect, that in most of the cases using observe_field results much more code generated than just using native hook onkeydown. ...

How to protect a form HTML/PHP with JS callback to AS3

Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is di...

How do I retain uploaded files after POsting a form with a file upload?

Hi guys is it possible to be able to retain an uploaded file AFTER its been uploaded I mean I'm building a compose email application. Users can upload files as attachments. AT times out of 10 uploaded files one of them isn't uploaded correctly or the submitted form is invalid the compose page would be displayed again however the user wou...

ASP.NET DropDownList posting ""

I am using ASP.NET forms version 3.5 in VB I have a dropdownlist that is filled with data from a DB with a list of countries The code for the dropdown list is <label class="ob_label"> <asp:DropDownList ID="lstCountry" runat="server" CssClass="ob_forminput"> </asp:DropDownList> Country*</label>...

CakePHP two forms next to eachother instead of below eachother

Im developing an form in cakePHP where i want to set two forms next to eachother. Im creating it using this code. echo $form->input('timeback', array('options' => array('week',1,2,3,))); This creates a dropdown. Followed by this code: echo $form->end('submit'); This all works well, accept that these two forms should be next to eachot...

Foreign Characters not displayed correctly in form components

I retrieve data from a MySQL database which is often in foreign languages and encoded with UTF-8. This displays fine normally but when set as the value for a textarea or text box it doesn't display correctly. Infact it looks like this: &#1099;&#1082;&#1072;&#1077;&#1087;&#1085;&#1088;&#1086;&#1096;&#1075;&#1091;&#1074; When normally ...

Send Keyboard Events from one Form to another Form

Hello, my question is quite simple: Our C# application has one MainForm with a menu and several keyboard shortcuts associated with the menu entries. Now we need to trigger the menu entries from some child forms too. But since the MainForm is inactive when one of the child forms is active, the shortcuts do not work. Is there a simple ...

Render multiple Form instances

I have a simple application where users are supposed to bet on outcome of a match. A match consists of two teams, a result and a stake. Matches with teams are created in the Django admin, and participants are to fill in result and stake. The form must be generated dynamically, based on the matches in the database. My idea is to have on...

Delphi : What is the best way for passing data between forms?

It may seem a little newbie, but I really have got problem with it. I have a form (not the main one)for getting many different data from the user and I want to pass it to a manager class for creating an object with these. The problem is that I can't have this class to use the other unit (getting circle uses) and also it doesn't have acce...

How to get the right row in a sorted DataView?

Hi, I have a DataGrid containing a small table. Until now, I had a double click handler on this grid which iterated over all rows to find the selected one: DataTable table = (DataTable)this.dataGrid.DataSource; int selectedRow = -1; for (int i=0; i<table.Rows.Count; i++) if (this.dataGrid.IsSelected(i)) selectedRow = i; break...

ASP.NET Forms automation/serialization/binding

I need to implement many forms in ASP.NET application (for IRS mostly). There are will be a lot of standard controls for each form (textboxes, dropdowns, checkboxes, radio). And business entity assigned to each. What's the best solution to automate this process? I need to: Have layout stored in DB (in XML). Layout must support severa...