forms

input name and id changes when set runat=server

[亡魂溺海] 提交于 2020-01-09 03:40:05
问题 In my form I need to insert different inputs of type "text". The inputs must be html controls with name and id's. Because I send this form to a external url. For the validation I do runat=server in all inputs and then I can use requiredfieldvalidator. But the problem is when I look in the source after visiting the page the name and id's are all changed. for example <input id="first_name" class="formright" type="text" name="first_name" runat="server" /> changes to <input name="ctl00$cphContent

Form validation fails due missing CSRF

一笑奈何 提交于 2020-01-09 02:24:29
问题 A few days ago I have reset my local flask environment without having captured the dependencies via a pip freeze before I deleted it. Hence I had to re-install the latest version of the entire stack. Now out of the blue I am no longer able to validate with forms. Flask claims CSRF would be missing. def register(): form = RegisterForm() if form.validate_on_submit(): ... return make_response("register.html", form=form, error=form.errors) The first time I send a Get I retrieve an empty form

HTML input type=file, get the image before submitting the form

我怕爱的太早我们不能终老 提交于 2020-01-08 16:02:14
问题 I'm building a basic social network and in the registration the user uploads a display image. Basically I wanted to display the image, like a preview on the same page as the form, just after they select it and before the form is submitted. Is this possible? 回答1: Here is the complete example for previewing image before it gets upload. HTML : <html> <head> <link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />

Windows Forms color variation between Windows 7 and XP

非 Y 不嫁゛ 提交于 2020-01-08 05:40:08
问题 I have a vb.net Windows Forms app using the 4.0 framework. When I run the application on an XP machine, the color of my controls all match what the are set to in my IDE, which is also an XP machine. When I run this application on a Windows 7 machine, the colors are all changed. Any ideas why this is and how I can make Windows 7 match my Development machine? David 回答1: Windows forms are going to take on whatever "theme" the machine they are running on has enabled - which is by design. Honestly

Populate second select list based on first select list value [duplicate]

落花浮王杯 提交于 2020-01-07 09:53:07
问题 This question already has answers here : “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP (28 answers) Closed 3 years ago . I'm trying to do a nested select list which is not working The values of the second select list dont get populated. Here is my code. I populate the first select and based on its value getter.php is called dynamically to populate the second select box (which is not working) <div class="col-sm-3"> <label for="rg">Region<

Symfony: unable to handle request in form

一曲冷凌霜 提交于 2020-01-07 09:04:27
问题 I have 3 form types ( SearchForm - SearchField - SearchFieldType ), each one including next like this: SearchFormType : <?php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class SearchFormType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) {

jquery dynamic form, event on dynamic field

倖福魔咒の 提交于 2020-01-07 09:02:53
问题 I have started to create a dynamic form using jquery to create each question at a time but there seems to be an issue with an event on the dynamic content. div class="container"> <h1>Add or Remove text boxes with jQuery</h1> <div class="row"> <div class="col-sm-6"> <div class="my-form"> <form role="form" method="post" action=""> <div class="form-group text-box"> <label for="box1">Question <span class="box-number">1</span></label> <input type="text" name="boxes[]" value="" id="box1" /> <!--<p

jquery dynamic form, event on dynamic field

浪子不回头ぞ 提交于 2020-01-07 09:02:08
问题 I have started to create a dynamic form using jquery to create each question at a time but there seems to be an issue with an event on the dynamic content. div class="container"> <h1>Add or Remove text boxes with jQuery</h1> <div class="row"> <div class="col-sm-6"> <div class="my-form"> <form role="form" method="post" action=""> <div class="form-group text-box"> <label for="box1">Question <span class="box-number">1</span></label> <input type="text" name="boxes[]" value="" id="box1" /> <!--<p

Creating an SQL table with email address as title

送分小仙女□ 提交于 2020-01-07 08:26:43
问题 I'm struggling to create SQL tables using email addresses as the table name. The code I am using produces the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@gmail.com( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR' at line 1 and the related code is: // create new table for users tosses // Make a MySQL Connection mysql_connect("localhost", "$sqlusername", "$sqlpassword") or

How to perform logic if findBy’Field’ does match?

假装没事ソ 提交于 2020-01-07 08:23:07
问题 I trying to do some logic if my inputed form email matches one found in the database. How do I make the comparison if the findBy’Field” returns the whole collection instead of just the field I want to compare to? I'd think it should be done without using a foreach loop as that would kinda defeat the purpose of using my findBy method. An Example: $formEmail = $form->get('email')->getData(); existingEmail = $em->getRepository(‘UserBundle:User’)->findOneByEmail($formEmail); // or existingEmail =