forms

Submit a radio button as a file input

I have a set of radio buttons with values like this: <input type="radio" value="http://www.foo.com/image1.jpg" /> <input type="radio" value="http://www.foo.com/image2.jpg" /> <input type="radio" value="http://www.foo.com/image3.jpg" /> But on submit I'd like it to treat the selected radio as if it were a file input, using the value as...

How do I prevent form submission until multiple ajax calls have finished? jquery

Following on from a previous question where I asked about disabling a submit button until all ajax calls have finished returning... It seems that people are still managing to submit the form even with the button disabled and a warning sign. I guess it could be from pressing 'enter' in a text input. How do I go about disabling the whole...

Submit text and Wysiwyg form to both Database and flat file.

I've created a form that is made up of 2 input fields and a wysiwyg text area (ckeditor). I have a function using ajax to gather the ckeditor data to be submitted. I have the form properly submitting to the database, but I also need it to write to a text file. How would I go about doing this? Edit to include code: using onclick to subm...

ASP.NET MVC 2.0 - IList<T> CheckBoxes

What is the best way to handle this: class Option { int id; string name; } class QuoteItem { IList<Option> options; } class QuoteViewModel { IList<Option> allOptions; QuoteItem quoteItem; } Basically, I have all the available options in allOptions. I want to have a checkbox that puts another Option (even if it...

How to reference text Label outside of Form's code?

Code Sample 1 //Set Label. this->TextLabel1= (gcnew System::Windows::Forms::Label()); Code Sample 2 //When Button Clicked.... TextLabel1->Text = "Button has been pressed"; How do I reference (+ change) the Label that has been set, outside the Form's code. Eg. Another cpp or header file? ...

Form submits twice when pressing return/enter

I'm using anchors as links, and also I'm binding the enter/return key to submit a form, like this: $("form[name!=smsform]").bind("keyup", function(e){ if(e.keyCode == 13){ $(this).submit(); }); $("a[title=submit]").click( function(){ $(this).parents("form").submit(); }); However the form submits twice when clicking enter/return using...

Zend Framework - JQuery - Ajax update on Select element change

Hi, I am pretty new to the zend framework and the JQuery helper. I have been playing around with the ajaxLink method, and was wondering if there's a way to adapt it to use it in a form. Let me explain: I want to add an "onChange" attribute on a "select element" in a form. When the select element is changed, I would like to have an aja...

Ideas and solutions for validating this form is wanted...

I have a form which I need to validate the easiest and most safe way. This is for a classifieds website! Now, I have several categories which the user may chose from, and then with javascript I display subcategories depending on which category is chosen. The subcategories are actually DIV:s which have their display property set to eithe...

How to write this regexp?

I am validating a field which may NOT be anything but numbers, but may include a space or a minus-sign. This is for validating phone number field! So, these criterias should be met: (might have forgot a criteria, if so remind me) 1- Atleast 5 numbers 2- May contain space 3- Not shorter than 5 characters 4- Not longer than 20 charac...

Fading form values with jQuery

Is there any way to fade out the set value of a field on focus, and then fade it back in on blur if nothing was entered? I'd like to fade out "Enter your name..." on focus, but fade it back in on blur if the user didn't enter anything. Thanks! ...

jquery passing values from one form to preivous form

Is it possible to find out what form you're currently on from a js file? This is my issue.. I have a form, form1, that includes a table.. when a row in the table is clicked on another form pops up, form2. If the user "saves successfully" on form2, the form closes and form1 comes back into focus..my question, is it possible to send an id...

Django FormSets as Fields of another Form

I have a Django model that looks like this: DEFAULT_PROFILE_INFO = [ {"name":"About Me", "body":"Super programmer", "public":True}, {"name":"Research", "body":"Various topics", "public":False} ] class Profile(models.Model): user = models.OneToOneField(User, unique=True) info = JSONField(blank=True, default=DEFAULT_PROFI...

Pure CSS form styling with columns??!

I have a form that I need styled to have 2, 4, and 6 columns. I named my classes col2, col4, and col6 respectively. I am having a lot of trouble especially with vertical alignment and the columns themselves. Can anyone help with this? <div id="fieldset1" class="col2"> <fieldset> <legend>Living Room </legend> <div cl...

asp.net mvc form field contained ,,

My MVC application has a form with many fields. When I submit the empty form, some of the field values returned were ,, (two commas). string value = form[key]; // value is ,, I was expecting to see an empty string, not 2 commas. ...

Functional testing form with CSRF enabled in Symfony

What is the best way of creating functional tests to test forms with CSRF protection enabled in Symfony? Currently I have to add the following code before each form submittion: $form = new sfGuardFormSignin(); $token = $form->getCSRFToken(); $token_name = $form->getCSRFFieldName(); Then I add the $token and $token_name to form ...

add extra field to form not working

Hi, I have a working recommend to script, I just wanted to add a extra field named fename, now I get an error like this: Parse error: syntax error, unexpected $end in this is the html form: <form action="action.php" method="post"> Uw naam:<br /> <input type="text" name="name" size="25"><br /> <br /> Uw e-mail adres: ...

help with making this regExp in js

I need to compare a textarea to make sure: It's not ONLY SPACES and not ONLY RETURNS(new lines) and NOT ONLY a combination of these two. However, if there are more than 3 characters OR numbers, then it is okay. Not more than say 2000 characters. Imagine a textarea, I don't want the form to submit if the user have pressed enter (new l...

Why isn't this regExp working?

I have this to validate a textarea. Here is the exp: var desExp = /^\s*(\w[^\w]*){3}.*$/; This works fine when typing on one line something like "really nice car". But when typing into several lines like this: Got receipt. Brand new! // new line here Shipping included. // new line here 0704-256568 I think the error comes up be...

How to dynamically load a value into a text field???

Hello guys, I am having a small problem with pushing a value into a input text field and have it pass on to the next step upon submitting a form in IE. This process works just fine in FF and Chrome and pretty much every other browser. Here is the input field: <div id="donate_form_gift"> <fieldset id="donate_form_g...

Nested forms and automatic creation of parent, children

Guys, I was wondering if it was possible to create new parent, children in a has many relationship, using rails nested forms. Rails documentation clearly says that this works in a one to one relationship. Not sure if its the same in has many relationship. For example: If params = { :employee => { :name => "Tester", :ac...