Questions tagged [form]
An HTML form is a section of a document containing normal content, markup, special elements called controls and labels on those controls.
392
questions
2
votes
1
answer
1k
views
Submit random choices on Google form
I've written a Python script that randomly selects radio buttons for each question, and submits the google form. My main questions for improvement are:
Algorithm: I collect all the buttons into a 2D ...
1
vote
0
answers
49
views
Three HTML dropdowns, where some options get disabled depending on earlier selections
I am making several dropdowns dependent on each other.
Data used to form dropdowns:
...
4
votes
2
answers
24k
views
onChange vs onKeyPress for input in React
I have an input form, and when you press enter I want it to call a function. I was wondering what "the right" way of doing this is.
Right now I have an input looking like this:
...
4
votes
0
answers
170
views
Vuejs - input validation
I'm in a project that's currently using vue. I'm at the moment developing validations for the inputs and in a way to make them more flexible, my idea was to create an intermediate component "...
4
votes
1
answer
185
views
Setting all hidden fields based on id
I am working on a web page where there is a checkbox with a value and a hidden field. I want to ask your opinion on whether this logic is sound.
My logic
The checkbox has a value that matches the id ...
3
votes
0
answers
136
views
Django form for product stock, where products from the same batch must be merged
Here is the context first. I have a 'Stock' table, in which I record all the stocks with as information: the product, the ...
5
votes
1
answer
86
views
Secure password generator form
With the demise of passwordsgenerator.net I wrote my own generator;
Please review with an eye on correctness and maintainability;
...
2
votes
2
answers
425
views
jQuery form.find radio class
In my application we have four inputs that are radio controls and the first radio control is checked by default. When the user selects another radio control and then saves the form I want to get the ...
0
votes
0
answers
39
views
Unit test for a registration form using C# and Selenium
I would like to know if the below code written in C# Selenium to do Unit Test is efficient and readable. Is there any particular way to do Unit Test. Else suggest me where I can learn to do better ...
0
votes
0
answers
16
views
best way to check if every part of a stepper is valid and emit an event then
I want to check if each part of my multipart form is valid inside my stepper component, if it's the case I intend to emit an event that can be handled by the parent component.
To do this, I have made ...
0
votes
0
answers
24
views
Simple Todoesque React Component for selecting Multiple Choices in a form
I was recently pinged about a quiz app a friend of mine was building with React Native for fun they were having minor brain farts over handling a multichoice answer template and asked me to look over ...
0
votes
0
answers
24
views
Custom duration input component
I would love some pointers in terms of clean code, performance and maybe edge cases that I missed.
Component Template
...
7
votes
2
answers
494
views
OOP PHP form builder with validation
Yes, another PHP form builder... I wrote this solely to demonstrate OOP principles.
My questions are:
Could this be written better? OOP-wise.
How could I better implement error handling?
Index.php
<...
0
votes
1
answer
66
views
Range slider show/hides and reset (vanilla js)
I have a HTML5 range slider. i.e. ...
1
vote
0
answers
100
views
Multi-step form in React + Formik
I did a multi-step form. I only learn how to build applications, and would like you to check my code out, whether everything is done well, and so on. PropTypes checking was not implemented ...
1
vote
2
answers
79
views
Having trouble deleting multiple queries (PHP, MYSQL)
I'm having trouble making WHERE IN query work, I was only able to make it work as a foreach loop.
My payload looks like this:
sku[]: BOOK0002
sku[]: BOOK0003
My ...
2
votes
0
answers
59
views
Accessible nested multiselect list
I'm trying to figure out the most accessible and semantic way to allow users to select one or more options from a hierarchical list. Think a taxonomy of categories and subcategories.
I came across a ...
3
votes
2
answers
2k
views
Simplifying Counter of Checked Checkboxes
Is the following code a proper solution to my problem? I have a feeling it can be simplified quite a bit.
If one of the first four checkboxes is checked the sum is 1; if two 1.5; if three 2; if ...
5
votes
3
answers
1k
views
Dynamic country, state select options
Here is code I wrote to dynamically choose between three country options (United States, Canada, Other). After the user selects a country it will show the related select option or an empty input (when ...
2
votes
1
answer
5k
views
Created a frame with a disabled button, till check button is used, then return to starting state
I've been coding Python for little over 6 months now. I am self taught and I would like to ask for some help for myself and also for others in my position who's been wondering if they're going about ...
4
votes
1
answer
105
views
WordPress contact form plugin PHP and WP_REST improvements
TL;DR
This month I wanted to improve my WordPress knowledge and create a simple form that wasn't bloated with features but was secure. I wanted to make sure this plugin improved my knowledge of:
...
2
votes
1
answer
935
views
Bootstrap form with floating labels
I have turned a "classic" Bootstrap form into a "floating labels" form.
For this purpose, I had to move the labels below the form controls.
...
1
vote
0
answers
65
views
Flask API for converting Contact Form responses to Email notifications (with reCAPTCHAv2)
Introduction
I wrote a proof-of-concept Flask server that accepts responses from a contact form and converts the data submitted to an email. I have added a rudimentary honeypot field that causes the ...
1
vote
1
answer
78
views
PHP function that clones HTML form structure to MySQL database structure
I built a function that should greatly simplify working with long HTML forms, that save data to MySQL using PHP.
My forms usually have several hundred input elements that are added / altered / removed ...
3
votes
1
answer
202
views
PHP Form with reCAPTCHA v2
I managed to make a very simple contact form.
I used PHP for server-side validation and reCAPTCHA v2.
You can access the form at the following link:
https://test.dexsolutions.digital/index.php
And ...
2
votes
1
answer
8k
views
Parsing multipart/form-data in php for PUT requests
I have recently found that I needed to be able to parse multipart/form-data for PUT requests made to my REST API. This allows batch photo uploads, which has been a requested feature. As we all know, ...
4
votes
2
answers
4k
views
PHP loop to generate an HTML form for the days in the coming week
There are two arrays, $states and $weekdays. I want to loop through them to create a form, an HTML table, or possibly some other ...
3
votes
2
answers
378
views
Python Back-end registration validation
I'm working on a personal project (Flask CRUD app) and I am currently building the user service. I am trying to use as less as libraries as possible (that's why I do not use WTF-forms for example, ...
6
votes
1
answer
107
views
Basic login system with 2 factor authentication
What I try to achieve
I need to create a administration-panel for a website. Therefore, I need a possibility to protect the content of the panel via a password. The functionality doesn't have to be ...
1
vote
1
answer
62
views
How can I upgrade my validation in JavaScript?
How to improve my validation in JavaScript?
Namely I am wondering whether some parts of code can be shortened, improved, or removed althogether.
I don't want to change the ES5 syntax because so far I ...
2
votes
2
answers
177
views
Dynamically displaying or hiding checkboxes based on region selection country. Also select All / None included
This is basically my first real venture into JS coding ... I think what I have put together here is quite long-winded and could be streamlined but I'm not quite sure how.
I have a table with Columns &...
4
votes
1
answer
203
views
Displaying Media with HTML and JavaScript
I have a personal website that I use to share videos and images with friends. Below is a media generator using JavaScript and HTML. Its main purpose is to display one image at a time at the click of a ...
7
votes
1
answer
3k
views
Get checkbox value of unchecked checkboxes in a table
I have a table where a user can (un)check checkboxes among other features in each row.
I faced the problem that I don't receive unchecked checkboxes to my backend.
This led to a bigger issue since ...
8
votes
2
answers
431
views
RGB <-> HSL converter + hue shifting
My input is basically a .png image from the img/ directory (I figured out that I should parse it, because there is an exploit ...
1
vote
0
answers
5k
views
Checkboxes behave like radio buttons with angular
This is short Angular 5 code which works as intended: check boxes behave like radio buttons - only one can be selected at a time.
Both versions of 'toggleCheckbox' works but I am interested is if ...
3
votes
0
answers
93
views
Validating a file input whose value is reset to empty string ("") after selection
My form comprises of a mandatory file input.
The form is validated according to the jQuery validate plugin.
The file input has attribute required so that the ...
6
votes
1
answer
21k
views
Spring MVC dynamically adding form elements
I made a simple form with an option of adding one text field dynamically on mouse click. And I will be grateful for suggestions on how I may improve the code.
...
2
votes
0
answers
53
views
Credit Card Form using RXjs
I am trying to improve my skills and I'd like to work on avoiding bad practices and mistakes.
Can anyone skim over my code and point out what should have been implemented more efficiently or in a ...
3
votes
0
answers
56
views
Reduce cluttering in a VPN initialization dance implementation (html, xml extraction and api calls) in Go
I'm still rather new to Go and I wanted to convert a part of a Python script I wrote a while ago to perform the VPN initialization dance (basically a set of API calls + parsing to fetch an auth cookie ...
3
votes
1
answer
70
views
Basic input system for a few form fields
I am attempting to port a linear function that I designed in a spreadsheet into HTML and Javascript. It's based on linear least squares where I have to take a Matrix and multiply it by its ...
2
votes
2
answers
10k
views
Form for OTP entry with six single-character text fields
I am working on an app in which I have to pass 6 digits OTP through 6 textFields in which you to provide only one character and after that it automatically goes to ...
2
votes
0
answers
179
views
Angular forms - reactive vs. [(ngModel)]
I am developing this angular app and it has big forms with 100 + fields. I was thinking about using [(ngModel)] without reactive forms, so that it's easier to do ...
3
votes
4
answers
2k
views
Calculate inputs average
I'm creating an online calculator to get the average grade of different tests my students take. I wonder if you see any problems in the following code or any way to improve it:
...
1
vote
0
answers
254
views
React Native form for entering one-time password [closed]
Here is the React Native code to optimize: it's an OTP form. I want it to be as small as possible.
...
5
votes
2
answers
562
views
Calculator app in React
This is a simple calculator app that involves entering two numbers and allowing them to be editable and swappable. Calculations are done on the numbers, so the calculations should only be done when ...
2
votes
1
answer
51
views
Date prompt React.js component
I have created a date component (working GIF at the bottom; please ignore the styling).
There isn't a problem with the working of the code but rather the code I wrote seems messy and something hard ...
4
votes
0
answers
53
views
Form deserializer for Python Flask
I've started working on a small Flask project for no real reason other than fun, and pulled myself back on form validation. I realize that there are existing libraries like WTForms, but wanted to try ...
3
votes
1
answer
442
views
Calling a Luhn check function when a credit card field changes
I feel like I should not be duplicating the code to gather the credit card number, but I am not sure how best to do it. Any suggestions?
...
2
votes
0
answers
161
views
jQuery validation for multi-page registration form
I use JS/JQuery validation for radioboxes, input field etc. Because of AJAX I use one global validation (in a separate file) and 4-5 other files to coverage actions in a relevant registration form ...
2
votes
3
answers
2k
views
Using jQuery to set the class of an element corresponding to the selected radio button
I'm a bit of a newb with jQuery but can get it working to perform the functionality that I'm after.
The below function checks the value of the radio input and then adds a class, depending on the ...