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
1answer
553 views

Form validation for multiple inputs

I created an example of a simple form for multiple inputs (name and phone number) in React. If the user enters invalid data in input field, error text is displayed near the same field. I learned a lot ...
-2
votes
1answer
76 views

My code is contain some vulnerabilities, how can i correct it and make it better

My code works well, but i still don't think it is well written. Can someone help to improve the code so as to get rid of vulnerabilities. My php code: ...
4
votes
1answer
82 views

Users adding each other in Laravel

I'm looking for a code review for the following system that I created. It allows a landlord, to add a tenant to start a tenancy. It has added, accept, reject, and prohibits a tenant from adding ...
2
votes
1answer
84 views

A basic form with React

I have been working of a basic from using React and I need your help to improve this part of my code, especially validate and ...
1
vote
1answer
5k 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: ...
2
votes
0answers
477 views

CodeIgniter CRUD form validation

I've developed a crud "helper" of sorts. Fields/columns are derived from the database and contain everything from the name of the field to the type and size of the field. Part of the system integrates ...
1
vote
0answers
47 views

Class to handle complex form using Angular ReactiveForms

I'm working with the ReactiveForms in Angular5 and trying to find a good way to do this. So, in my use case, I have a FormGroup inside my example.component.ts and when I need to add some FormControl ...
1
vote
0answers
818 views

Autosave reactive forms

I'm building an autosave for a data driven form on Angular. Here is our code snippet: ...
2
votes
1answer
75 views

Insert contact information from form fields into MySQL database when button is clicked

I am just a beginner trying to do my due diligence and research things properly. I am trying to go about the correct way of adding data into a database. I have read articles on the following: Not ...
2
votes
3answers
202 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 ...
7
votes
2answers
5k views

Simple checkboxes with React

I was given the following exercise as part of a job interview process. I submitted my code and received the feedback that my solution is "close" but not "correct". My code executes just fine and ...
4
votes
1answer
905 views

Layout for a Tkinter form

I am making a GUI application for a class. I have made the form layout (make_form()) using both Frame and grid, but I am not exactly sure that one should be mixing ...
5
votes
2answers
222 views

Address form validation

I need help with this code. How can I make it shorter? How can I create an array with the names, for example, errors, and modify code without so many If statements? ...
3
votes
1answer
130 views

Abstraction of google analytics with click events and forms submission handling

I'm keen to get some feedback on how I have utilized the Revealing Module pattern here. This code is part of a web application that is used by the public. The purpose of this code is to encapsulate ...
4
votes
0answers
111 views

Salesforce controller to implement a dynamic form

The code below is a controller for a Visualforce page (form). The controller determines if the form was previously created and saved or saved in progress in a previous action. If the form is new it ...
4
votes
2answers
2k 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 ...
1
vote
1answer
91 views

Preventing resubmission of form using timestamp

I am working on a method to prevent users from resubmitting a PHP form and I thought of many methods, but this one seemed to be the most reliable in my tests. I did not want to create redirects for ...
4
votes
4answers
8k views

JS Function warning before closing browser

I have a function that makes sure the user wants to actually leave the page. I am not a jQuery expert. Is the code below the most efficient way to do this function? Or can it be simplified much more ...
3
votes
0answers
3k views

React component: click to edit text

I am an experience backend programmer wanting to bring my frontend skills up to par. (My js experience up to this point is mashing things until they work rather than structured frontend applications). ...
3
votes
2answers
106 views

Changing form display based on selected values

The first part of my code is a datepicker for a "From" and "To", showing the date in MMDDYYYY format in a textbox and having the value in the From field 7 days prior to the current date. Second ...
4
votes
0answers
64 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: ...
7
votes
3answers
9k views

Counting characters inside of a textarea using Angular

I have a textarea and need to calculate how many characters have been typed into it. Both of the following solutions work correctly—which would be preferable,...
1
vote
1answer
67 views

Submit form additions or changes using AJAX, and display result

I am submitting my form using ajax. Here is the actual code: ...
1
vote
1answer
91 views

Tying the enablement of one checkbox to another using AngularJS and jQuery

I'm new to AngularJS, coming from a jQuery background and I have a situation I've solved but only by including jQuery in an AngularJS function. Something just doesn't feel right doing this and I was ...
8
votes
5answers
3k views

Selecting checkboxes based on URL parameters

Is there any way to reduce these lines of code? ...
1
vote
1answer
162 views

Handling two buttons that submit a form using AJAX

I am currently handling forms by binding submit event and then calling the ajax() function: ...
7
votes
1answer
70 views

HTML Date Selector

I made a date selector in HTML, which accounts for leap years and the number of days in each month. I am relatively new to javascript / HTML so please critique it as much as possible. ...
5
votes
0answers
57 views

Building a form for rebooting many network devices

I have several IP based devices that, due to building maintenance, occasionally lose their communication with the other devices. Normally you'd have to find the device IP, go to its control page and ...
1
vote
2answers
123 views

PHP form simple validation

I'm quite new to php (learned and only used C# for web pages so far) and wanted to know if this is the correct approach for validating a form. This is my userform.php code: ...
2
votes
1answer
2k views

Basic PHP contact form using PHPMailer

I'm developing a PHP contact form script for my first site, using PHPMailer. I'm mainly concerned about security issues since I'm rather new to PHP. I've learnt a lot from reading several code reviews ...
8
votes
3answers
1k views

Mask latitude text field

I have an input element on one of the pages. This input is supposed to take a string of digits from a user. In order to enhance UX I'd like to mask input's value at any given time. Like so: What came ...
5
votes
1answer
277 views

Validation for a user form using jQuery

I have a really bad habit at the moment with writing global specific functions to handle data and feel like I could reduce my work load by stop copying the same. Basically I have a registration form ...
1
vote
1answer
67 views

Objects using jQuery to maintain a playlist of shows

This is my first attempt at using OOP JavaScript in my work. I know the concepts but implementation is more complicated than I thought. Now the code is a mixture of several things (JavaScript/jQuery). ...
2
votes
1answer
82 views

Create a GUI to update parameters of an Object

I have an Glob object which represents a glob of data. It has several parameters like size, the date it was created, who created it, and so on. I'm building a GUI ...
1
vote
1answer
643 views

Filtering an array according to 7 checkboxes in a form

I am filtering an array whenever checkboxes are checked. ...
3
votes
3answers
157 views

Change text and styling of a form control when a slider value changes

Having a hard time to achieve what I'm looking for. I was thinking of using arrays but don't know where to start. Code below is what I want to shorten to get rid of multiple ...
0
votes
1answer
100 views

React components to render two kinds of form elements

I have two React components. The only difference is the input tag vs select tag. I'm trying to move the bulk of the duplicate code to a higher order component but I can't wrap my head around it. Any ...
4
votes
1answer
128 views

Handling two datepickers in a form with angularjs

Here's I am using simple form with angularjs. Everything works fine. I am having watchgroup for EndDateFrom & EndDateTo datepickers. When it's defined I am logging the value to console. I am ...
2
votes
2answers
113 views

Toggle the visibility of sections of a form

This code I written by myself. Here I have 3 main part. When I click on any main part then it sub part will appear. Sub part contain some check boxes. Here I have the following main functionality ...
3
votes
1answer
64 views

Triggering on form submit

In my HTML, I have a large form (id ="myform") that asks users to fill in 5 fields for Date of Birth (DOB), Sex, Weight, Hair Color and Eye Color and then several other fields which don't relate to ...
1
vote
0answers
41 views

Simultaneous search with Google and Bing, remember the last engine

A proof of concept app to run the same query on both Google and Bing. For instance, if one of the engines takes too long on a slow connection or the results are not satisfactory, the same query can be ...
1
vote
1answer
1k views

Approach to download files through POST request

I have a requirement to download multiple files using POST request. So I am using form submit to get this done. I have followed two approaches to accomplish this. Create a Form. Fill input details ...
0
votes
1answer
34 views

JS OOP Form Module to add sibling select elements

How can it be more cross-browser compatible, robust, better performance if possible? ...
5
votes
1answer
2k views

Moving items between two multi-select lists

I am learning object oriented JavaScript and come up with below exercise. There are two multi-select lists, one is source and other is target. User can move the item from source to target and vice ...
0
votes
3answers
3k views

Button to dynamically clone a form field

I am very new to javascript and started with a very basic add button to my django app. Everything I found was using jQuery but for only one small script jQuery seems to be a too big overhead for me. ...
1
vote
0answers
54 views

Generate user form fields based on a dictionary that may have nested dictionaries

This piece of code is doing what I need it to do but I'm still not happy with it. Here's the main logic to it: Iterating over a dictionary, I want to treat differently the one item that has the key '...
0
votes
1answer
40 views

Feedback form security [closed]

I have written a form to collect some feedback, which is written to a CSV file upon an Ajax post. In my feedbackapi.php file I have sanitised, done checks and then written the feedback to a CSV file. ...
0
votes
2answers
219 views

Handling missing elements on login form in Selenium

I try to improve my code so that I don't have to program a try - catch block all the time. e.g. at the moment I have to write many codeblocks like this: ...
3
votes
0answers
362 views

React component with conditional form loading

I'm remaking an existing application into a single page application. I've created this component to take the place of multiple pages in the previous version. It shows a form with disabled data about ...
1
vote
1answer
89 views

Validation form JavaScript

I am a beginner to JavaScript and I know about jQuery Validations however I do not want to use a foundation like jQuery just yet. I am wondering if what I have done its good or if there is another ...