forms

Spring MVC Form tags: Is there a standard way to add "No selection" item?

There is a select dropdown and I want to add "No selection" item to the list wich should give me 'null' when submitted. I'm using SimpleFormController derived controller. protected Map referenceData(HttpServletRequest httpServletRequest, Object o, Errors errors) throws Exception { Map<String, Object> map = new HashMap<String, Object...

Limiting impact of credit card processing scripts/bots

I'm involved in building a donation form for non-profits. We recently got hit by a fast round of low dollar submissions. Many were invalid cards, but a few went through. Obviously someone wrote a script to check a bunch of card numbers for validity, possibly so they can sell them later. Any ideas on how to prevent or limit the impact of...

validating and adjusting a treeview label

Hi, I've got a treeview control, and have caught its after-label-edit event. I want to be able to validate the user's input and adjust it - if for instance it's too long - but I only seem able to cancel the new value, not change it. Any ideas? I don't want to have to open a new form, the user might be renaming a range of these and it...

Form Elements in ASP.NET Master Pages and Content Pages

OK, another road bump in my current project. I have never had form elements in both my master and content pages, I tend to have all the forms in the content where relevant. In the current project however, we have a page where they want both. A login form at the top right, and a questions form in the content. Having tried to get this i...

Are there caveats to dynamicly creating a form with javascript?

I have to do a cross site POST (with a redirection, so not using a XMLHTTPRequest), and the base platform is ASP.NET. I don't want to POST all of the controls in the ASP.NET FORM to this other site, so I was considering dynamicly creating a new form element using javascript and just posting that. Has anyone tried this trick? Is there an...

What is the best way to track changes in a form via javascript?

I'd like to track changes in inputs in a form via javascript. My intent is (but not limited) to enable "save" button only when something has changed alert if the user wants to close the page and something is not saved Ideas? ...

Multi page forms in Rails

I'm having a quite complex model with many fields, has_many associacions, images added by image_column etc... New object will be added by multi page form (8 steps) - how shoud I accomplish validation and propagation between those steps? I think validation_group could be useful for defining validations for each step, what about overall ...

What is the best way to update form controls from a worker thread?

I've done some research and I can't really find a preferred way to do updating of form controls from a worker thread in C#. I know about the BackgroundWorker component, but what is the best way to do it without using the BackgroundWorker component? ...

jquery image selector not working in IE7

So I have some html like so: <div id="avatar_choices"> <label for="id_choice_0"> <input id="id_choice_0" type="radio" name="choice" value="7" /> <img src="someimage.jpg" /> </label> <label for="id_choice_1"> <input id="id_choice_1" type="radio" name="choice" value="8" /> <img src="someimage2.jpg" /> <...

In Django, how could one use Django's update_object generic view to edit forms of inherited models?

In Django, given excerpts from an application animals likeso: A animals/models.py with: from django.db import models from django.contrib.contenttypes.models import ContentType class Animal(models.Model): content_type = models.ForeignKey(ContentType,editable=False,null=True) name = models.CharField() class Dog(Animal): is_lucky...

Buffered Multipart Form Posts in Ruby

I am currently using Net::HTTP in a Ruby script to post files to a website via a multipart form post. It works great for small files, but I frequently have to send very large files using this script, and HTTP#post only seems to accept post data as a String object, which means that the file I'm sending has to be read into memory before a...

How to handle checkboxes in ASP.NET MVC forms?

This seems a bit bizarre to me, but as far as I can tell, this is how you do it. I have a collection of objects, and I want users to select one or more of them. This says to me "form with checkboxes." My objects don't have any concept of "selected" (they're rudimentary POCO's formed by deserializing a wcf call). So, I do the followin...

How to check for optional fields in $_POST

At the moment my code looks like this: # Assign values for saving to the db $data = array( 'table_of_contents' => $_POST['table_of_contents'], 'length' => $_POST['length'] ); # Check for fields that may not be set if ( isset($_POST['lossless_copy']) ) { $data = array( 'lossless_copy' => $_POST['lossless_copy'] ); ...

How do you handle the output of a dynamically generated form in ASP.NET MVC?

Say you create a form using ASP.NET MVC that has a dynamic number of form elements. For instance, you need a checkbox for each product, and the number of products changes day by day. How would you handle that form data being posted back to the controller? You can't set up parameters on the action method because you don't know how many ...

A form that spits out the input

I can't for the life of me find a form that DOESNT email the results that you submit. I'm looking to find a form that I can have users enter simple data that i can then spit back out at them in different arrangements. If they submit First and Last, I'll spit out, amongst other things, [email protected]. I'm willing to scrounge the co...

Need help getting info across a UI thread and another thread in C#

I have a server application that receives information over a network and processes it. The server is multi-threaded and handles multiple sockets at time, and threads are created without my control through BeginInvoke and EndInvoke style methods, which are chained by corresponding callback functions. I'm trying to create a form, in addit...

.NET: is there a Click-and-drag "Desktop-Like" control?

OK, first for context look at the Windows desktop; You can take items (folders, files) on the desktop and drag them around to different places and they "stay" where you dragged them. This seems to be a pretty useful feature to offer users so as to allow them to create their own "groupings" of items. My question is thus: Is there a con...

Multipart text field in pdf form, using OpenOffice Writer

So, this might be a crazy idea, so bear with me. [warning: hackish] Using OpenOffice.org Writer, one can easily make simple pdf forms (since Writer does XForms, and can export to PDF, and embed the form using FDF). I'd like to make a text entry field with this property: if the field overflows, put the overflow on an additional pa...

How to pass parameter to servlet

How do I pass a parameter from a page's useBean in JSP to a servlet in Java? I have some data in a form that gets passed no problem with a submit button, but no way to send anything else. Please help? Here is my code: <input name = "deleteGameButton" type = "submit" value = "Delete" onclick = "submitToServlet('DeleteGameServlet');"> ...

How can I submit a form in RoR whenever an input textfield changes?

I am using Ruby on Rails. I want to create a filter field on a page such that whenever the input field's value changes I filter a list shown below via ajax. (Exaclty like the Users search works in Stackoverflow) For now, I made it run with a form_remote_tag containing a text_field_tag and a submit_tag, and it filters my list when I pus...