Skip to main content

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
108 views

Basic login form in React.js

I have made a very basic login/registration form in React.js. The inputted data is send to a Java Spring Boot Rest-API to create an user or to authenticate using JWT. But in this question I want to ...
2 votes
1 answer
2k 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. ...
3 votes
2 answers
683 views

PHP HTML form Class - so far so good?

I am writing this class to render HTML forms. It is working as expected, so far. There are many things to be done yet (including testing). Is it ok to keep this way? ...
0 votes
1 answer
142 views

Generate HTML from input fields

I am building a small tool to generate a copy and paste HTML block, based on the user inputs. In the HTML file, I have all my inputs (select, checkbox, text inputs etc). I based myself on the JS of an ...
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
55 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
26k 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
180 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
538 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
304 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
89 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
454 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 ...
7 votes
2 answers
942 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
160 views

Range slider show/hides and reset (vanilla js)

I have a HTML5 range slider. i.e. ...
1 vote
2 answers
97 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
169 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
3k 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
107 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: ...
1 vote
0 answers
94 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
80 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
379 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
10k 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
5k 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
791 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
151 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
68 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
239 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
215 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
4k 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
465 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
253 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
58 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
59 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
72 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
12k 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
198 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
279 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
722 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
63 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 ...
5 votes
0 answers
57 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
443 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
191 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 ...
2 votes
1 answer
683 views

PHP LDAP credentials validation and error handling

I developed this group of scripts to validate users againts a LDAP server and presenting the appropiate message to the user after sending the information. I wonder if I'm handling everything properly ...
1 vote
0 answers
654 views

Putting a multichoicefield under a dropdown button

I am building a web app in Django where one of the form fields is a multiplechoicefield from a many2many object that I use to select users that are allowed to edit the post. In standard form the field ...

1
2 3 4 5
8