forms

Is it possible to get minlength value from formcontrol?

走远了吗. 提交于 2021-02-19 01:33:29
问题 So i have my form validation. And my question is can i get for example a minlength value which i passed at creating formControl? I havent found any information. This is my dumb component and i want to get minlength value to pass to information. Now i need to pass it via @Input(). title: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(20)]] . <div class="validation-window"> <p *ngIf="errors.required"> {{field}} required </p> <p *ngIf="formControl.hasError('minlength')"

Submit more than one form in Javascript/ajax or jquery

坚强是说给别人听的谎言 提交于 2021-02-18 22:55:47
问题 This is what I am trying to do I have 3 forms in one page, i need to have to because one form is open in modal dialog, I wish to submit all 3 forms when the user click in a single button, also I would like a ajax implementation of sucess en error function in the form submit <script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script> <script> var firstFormData = $("#form1").serialize(); var secondFormData = $("#form2").serialize(); var thirdFormData = $("#form3")

MySQL update, skip blank fields with PDO

邮差的信 提交于 2021-02-18 17:09:37
问题 I would like to update a MySQL row via the form below. The form works great as is but, if I leave a field blank, it changes the field in MySQL to blank as well. I would like to update the sql but skip over any fields that are blank. I have read a few ways of doing this but they didn't seem logical. I.e. using if statements in the sql string itself. (Having MySQL do the work that should be done in PHP). if($_SERVER['REQUEST_METHOD'] != 'POST') { echo '<form method="post" action=""> ID: <input

MySQL update, skip blank fields with PDO

我们两清 提交于 2021-02-18 17:09:27
问题 I would like to update a MySQL row via the form below. The form works great as is but, if I leave a field blank, it changes the field in MySQL to blank as well. I would like to update the sql but skip over any fields that are blank. I have read a few ways of doing this but they didn't seem logical. I.e. using if statements in the sql string itself. (Having MySQL do the work that should be done in PHP). if($_SERVER['REQUEST_METHOD'] != 'POST') { echo '<form method="post" action=""> ID: <input

MySQL update, skip blank fields with PDO

Deadly 提交于 2021-02-18 17:07:57
问题 I would like to update a MySQL row via the form below. The form works great as is but, if I leave a field blank, it changes the field in MySQL to blank as well. I would like to update the sql but skip over any fields that are blank. I have read a few ways of doing this but they didn't seem logical. I.e. using if statements in the sql string itself. (Having MySQL do the work that should be done in PHP). if($_SERVER['REQUEST_METHOD'] != 'POST') { echo '<form method="post" action=""> ID: <input

How to make a form always stay on top

走远了吗. 提交于 2021-02-18 11:19:30
问题 I have an application which consists of a form with FormStyle declared as "fsStayOnTop", so that it always is shown on top of all other windows. Now I would like to temporarily show another form where the user can set some settings. That form should also be shown on top, so I change the FormStyle property of the main form to "fsNormal" and the FormStyle of the form I want to show to "fsStayOnTop". When the temporary form closes the main form gets "fsStayOnTop" again. Now the settings form

AngularJS Upload and Post Multiple Files

放肆的年华 提交于 2021-02-18 08:15:18
问题 So ultimately, what I'm doing is trying to upload and post multiple files to a Django backend using AngularJS. I can post a single file, but it seems like when a FileList object is put in the $http.post data field, the backend no longer detects any files in the POST request. Here's what the html looks like: <form enctype="multipart/form-data" action="upload" method="POST"> <div class="form-group"> <span class="btn btn-info btn-file"> <i class="glyphicon glyphicon-file"></i> Browse <input

php submit only giving last value from array that populates form

拟墨画扇 提交于 2021-02-17 05:54:45
问题 Struggling with a one page form that i want to first populate a form from a mysql query, then enable a user to update some of the values in each of several table rows from text input fields in the form. The code's intent is to update the field by referencing the row ID. But for some reason I'm only able to update the last row in the form (the last row from the array). I've included some troubleshooting code to see what the ID variable is and it always comes up as the last iteration of the

Form not showing input data

烈酒焚心 提交于 2021-02-17 05:41:25
问题 I have a running form and it's half working. The form sends to my email address correctly but i'm having issues with the inputs not showing the text in the email. The only one that spits out any data is the message section. The name, email, phone and website inputs are not spitting out any data and I can't figure out why? // html5 code <form action="forms/get_form.php" method="post"> <div> <label for="name">Name</label> <input type="text" id="name" placeholder="enter name" required="required"

Codeigniter using form validation function “matches” with sub-array POST

喜夏-厌秋 提交于 2021-02-17 03:19:30
问题 Just started with CI last week and got this issue. What to put inside the matches function if I'm passing the form data as an array? I use array in the html form to locate all input fields inside single array in case I want to pass user generated input such as multiple phone numbers or emails. So everything is placed in array such as this: <div> <label for="password">Password</label> <input type="password" name="input[password]" id="password" value="<?php echo set_value("input[password]")?>"/