forms

Initialize a django.forms.ModelChoiceField, binded with foreign key, with default value

I have a model that contains a foreign key value, then in the form generated from this model as a ModelChoiceField. I want to auto select the user's (update_author). I've tried the below code, using the initial property. The view creates a formset with the the dates initialized to now() for the empty form. But, I want also the update_au...

Pass request to model form using generic view in Django

I using Django and a generic view "django.views.generic.create_update.create_object" I have a model form wich i pass to the generic view: url(r'^add$', create_object, {'template_name':'tpl.html','form_class':MyModelForm,'post_save_redirect':'/'},name = 'add'), I need to get current user in my ModelForm.save method.. But i can't find w...

qt - dynamic forms very slow

qt - This code very slow QWidget *MainWindow::loadUi(QString uiPath) { QWidget *newui; QUiLoader loader; QFile uiFile(uiPath); if(uiFile.open(QIODevice::ReadOnly)) { newui = loader.load(&uiFile); newui->show(); uiFile.close(); } else { QMessageBox::warning(this, "error", "o...

[symfony] How to use JavaScript in forms ?

How to add your own JavaScript to the forms which are generate by Doctrine ? For example, where can I add a script onFocus in an input form generated by symfony ? Edit : @Benoit : I have tried your method but, it doesn't work. My function renderJavascript : public function renderJavascript() { $(function() { $('.form').focus(...

How can I pass a forms checked checkboxes to a PHP page as an array using a jQuery submit function?

I have a that has a list of checkboxes and user can click any number then click submit. The list of checkboxes is generated based on the results of a mySQL query - echo("<form id=\"target\" action = \"#\">"); echo("<ul>"); while($row = mysql_fetch_array($result) { $the_value = $row['result_value']; $the_label = $row['result_label'...

ASP.NET FormView Update Fails

So below is my code. Where I'm having the issue is my bound text fields are not sending the information back to the UpdateCommand as expected. If I replace any of the @variables with hard coded text then the update occurs as expected. So if I replace @RegID with '25' then my record is successfully updated but blank as all other @variable...

Cannot store checkbox values in array to database for some reason!

Hi I am having an incredibly hard time with what should be a simple issue. As of CodeIgniter 1.7, '$this->input->post();' supported arrays but I cannot for get the values into the array for some reason. I have 7 check boxes that store into an array 'services[]' as you can see by this example view: <?php $servicesdata = array ( ...

jquery submit form

I got stuck today, been searching on stack overflow and google, however havnt had much luck in implementing the solutions I've seen. I have a form, Im trying to create, when i click submit when theres no info in the forms, it prompts an error (it didnt validate), however when everything is filled out correctly, the submit button no longe...

How do you implement a culture-specific address form using ASP.NET MVC?

We currently have a WebForms control with an update panel. The code-behind contains logic to show/hide fields based on the selected country. This is fine for WebForms, but we ware moving to MVC, and I'm having a hard time sorting this out. I also need this to be localized, both in terms of localizable resource strings as well as displayi...

How long do uploaded files stay on your server?

When I use a form to upload a file, it gives me the 'name' and 'tmp_name' and you're supposed to move the file from its temporary location in order to keep it. But how long does the file stay on the server before it gets deleted? Is it stored there permanently until you manually clean up your folders, or does it get deleted once the PHP ...

Merging PHP arrays

I am working on a project at the moment, that allows the user to create any number of news headlines, articles and images, the only rule with this system is that a headline must have an article and an image. My question is on my form when I submit I get 2 arrays one is the $_POST and the other is $_FILES. $_POST Array ( [campaign_...

how to add multiple rules with different handling on a field with jquery validate

how do i add Form validation, with multiple rules on a single textfield, and a different action depending on the rule for example, a faq module, with pre-defined questions, the user can save and / or publish his answers. i have a form, with 1 textarea and 2 buttons 1 button submits the form to save the entered value in the database a...

Auto populating text boxes on an Access 2003 form when value selected in combo box

Hello I am building a form in access database. I have a combo box which is linked to a query which is looking up a unique reference number from a table called Tbl_Submitted_Requests. What I need the form to do is auto populate the other text boxes when the user selects the unique reference from the combo box. How can I get the text bo...

Problems with UTF-8 accent Characters in JQuery form submission using Internet Explorer

Hi, I am using JQuery to submit a form with $.ajax() and then get the params in a php page to store them in a Database. My Pages are UTF8 encoded. Everything works well when I use Firefox. However, with Internet Explorer, when the data has accent characters in it, it discards these completely. I am using : $.ajaxSetup({ scriptCharset:...

Does Dreamweaver add enctype="text/plain" to forms automatically?

I have some forms that post to a CGI script. I set them up and they work perfectly on all browsers. Then I leave them alone. A few days later, after designers have updated the page, the forms no longer work and a mysterious enctype="text/plain" has been added to the form tag. I didn't put it there, and the designers didn't put it t...

Double POSTing user data - security risks/user experience/bad practise?

What are the issues with double POSTing user data? I am building a site for a client that requires login to a bespoke backend system that I am constructing, and login at the same time to a third party system hosted on a seperate domain. Client system is built in PHP and Vendor system in .NET. The login process requires both sites to pe...

How to prevent a form from submitting on page refresh?

Possible Duplicate: How do I stop the Back and Refresh buttons from resubmitting my form? I have a form that like most forms submits every time the user refreshes the page. Is there any way to prevent this so the form submits ONLY when the submit button is clicked and at no other times? ...

How can I get a div to appear when a textarea is in focus? (both are children of the same form element)

I'm having trouble getting my CSS to work :( HTML <form action="/api/submit/" method="post"> <textarea name="post" rows="2"></textarea> <input type="url" name="url" /> <div> <input type="radio" name="someName" value="someValue" /> </div> <button type="submit">Submit</button> </form> CSS form > input { ...

Auto-complete search box, selecting multiple values from results

I'm creating my own recipe box using php/mysql and one part I'm stuck on is actually creating the recipes, specifically selecting the ingredients. What I wanted to do instead is have a auto-complete search box where I can type out names of the ingredients, have the results drop down right below, and click the ones I'm looking for. After...

How to combine 2 values into one with jQuery

I am submitting a form element named "CCExp" it is made up of two select boxes #Month and #Year. I need to combine #Month and #Year so it submits as MM/YYYY. $("#CCExp").val($("#Month") + '/' + $("#Year")); Is this close? ...