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.
390
questions
4
votes
1
answer
199
views
Forms - Ordered fields vs. dynamic iterations
I've made about 2 forms that have a server side action using PHP. For the first one, I made a variable for every form field and mapped it to $_POST["name"]. For ...
4
votes
1
answer
194
views
Form validation evaluation to avoid exploits
Please advise if the form validation script below is secure enough to avoid most types (all types?) of contact form exploits? I ahve found this script online, added some extra php finctions in hope to ...
4
votes
3
answers
2k
views
OOP PHP form ok?
I am new at OOP and I wonder if the code below is OOP or it can be better and also what can be better?
...
4
votes
1
answer
672
views
Processing a form with PHP
I've seen few ways of processing forms with PHP. Whenever I am working with a form, I typically have two files: one for displaying the information (e.g. form.php) and the other for processing ...
4
votes
1
answer
1k
views
Uploading multiple files for faculty nomination system
I created a few forms for faculty members to nominate colleagues for awards. Many of the nominations require documentation to be submitted in order to validate the nomination. I created one form then ...
4
votes
1
answer
425
views
Generating a dynamically expandable form with multiple similar categories
Overview:
Here's the look of my form.
In this example, I have a form that allows dynamically adding fields in each category. Like, I can add multiple attractions like 5 attractions, same goes for ...
4
votes
1
answer
84
views
Check field values against a preset object
I want to check some fields values in a form against an existing object's values. If the values match, change a class value (it will add a sign). The following code is working, but I would like to ...
4
votes
1
answer
611
views
HTML5/CSS live Validation w/jQuery
I've been working on a live form validation project, initially I intended on finding a way to solely use CSS for said validation but it quickly became apparent I would require some jQuery to get it to ...
4
votes
1
answer
3k
views
Script for adding a set of form fields on clicking an Add More button
This is a script that I use to add a set of form fields on clicking an Add More button:
...
4
votes
1
answer
265
views
Security - Login system
For a school project I have been asked to create a login system for a website. The language I have to use is PHP with no database as of yet (for a later assignment). I'm just wondering if this code ...
4
votes
1
answer
889
views
Cross-browser double form submit prevention
We developed a potential solution for the double form submit prevention and we need some review on it. To be able to execute this code on asp.net we needed to add our function call directly into the <...
4
votes
1
answer
198
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 ...
4
votes
1
answer
205
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 ...
4
votes
1
answer
177
views
Enforcing numeric inputs and sanitizing different formats for IE11 input fields
I'm working on a web form that functions with numeric inputs. I have <input type="number"> input fields and with Chrome and Firefox things work nicely since ...
4
votes
1
answer
93
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 ...
4
votes
1
answer
1k
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 ...
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:
...
4
votes
1
answer
149
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 ...
4
votes
1
answer
214
views
Javascript contact form validation code
I'm a UI / UX Designer trying to sharpen my JS skills. I wanted someone else to check this code snippet and maybe have a Pro tip to improve or shorten it.
Javascript:
...
4
votes
1
answer
849
views
JavaScript function to create HTML select option elements
I made this function to get rid of writing numerical option values in a HTML-select manually.
From what I have seen so far it works as expected. But hints and suggestions are welcome anyway.
<...
4
votes
1
answer
2k
views
Phone number format and data entry restriction
I created a form that formats phone numbers, allows only allowable keys to be pressed, and converts a lettered entry into its corresponding phone keypad number. Is there some cleanup or better coding ...
4
votes
1
answer
87
views
Saving a form to a database
I have a windows form application which uses a form for two different purposes. We use the form for both our handheld system and our in-house system.
I would just like someone to review the code for ...
4
votes
1
answer
54
views
Handler for a screencast submission form
I have a monolithic script that powers this form:
Here it is:
...
4
votes
1
answer
685
views
Simulate the way that PHP receives the form
Let's say I have this form:
...
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 ...
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
0
answers
128
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
2
answers
58
views
Window-size-dependent content toggler for an HTML form
I had to build a responsive component which allows the user to display specific content in a page. I called it the contentToggler.
Here is my component in action
...
3
votes
3
answers
386
views
Triggering editing mode for a form
I think that my code isn't perfect and I need a help to understand how to optimize it.
In my application I have a main form and several forms for data editing.
The user can:
Add a new item
Edit ...
3
votes
2
answers
189
views
Client-side validator for contact information form (name, phone, e-mail)
My recent post had some things to fix. I think this should be well structured and written for you.
How does this code look to you? If something needs to be changed please tell me.
...
3
votes
3
answers
2k
views
Search form sample pattern
I've just started to practice coding in OOP and just wanted to ask if my code's pattern is correct. I need your comments or suggestions so I can improve it.
sample_class.php:
...
3
votes
2
answers
131
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 ...
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:
...
3
votes
2
answers
3k
views
Mutually exclusive radio buttons
Here is a small code snippet I wrote that I feel is pretty naive. I copied the code directly from my project and renamed some ID/class names.
I'd like to know how you could help to improve/refactor ...
3
votes
2
answers
183
views
Use presets to change a form
I intend to populate some fields in a form based on some presets values. The user choose the presets from a list. The following code is working, but as I'm a newbie, I would like to know if I done it ...
3
votes
2
answers
428
views
Wordpress php Contact Form - Security flaws
I have the following contact form included with my wordpress theme as a template.
Now a user on Stackoverflow pointed out that this form has some serious security vulnerabilities.
Could someone ...
3
votes
2
answers
417
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, ...
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 ...
3
votes
2
answers
310
views
Submitting an HTML form, adding submission to database and emailing the client and registrant
I have been asked to make a registration form that will add a users details to a database, create a registration code, then email the registrant and client the details including the registration code.
...
3
votes
4
answers
114
views
Verifying that all form fields are filled in
I grabbed the form from some random site because I'm only interested writing the javascript at the moment.
I am trying to check that a user has selected or entered text for all fields. I've made it a ...
3
votes
1
answer
184
views
Basic login script for educational purposes
I have created a login script to demonstrate the usage of sessions in PHP. The focus is not on security, databases or encryption. The idea is to exemplify how you can use sessions to protect pages ...
3
votes
2
answers
840
views
PHP contact form
I recently had my site hacked, with the main index file being overwritten (nothing else was touched). I'm assuming they hijacked my form input.
Are there any vulnerabilities in the code or does this ...
3
votes
2
answers
186
views
Initialise simple_form object inline
Using Rails 4 and a simple form, I'm rendering a couple of forms outside of their native controllers. Rather than scattering initialisers through my controllers, I wondered if it is cleaner to do the ...
3
votes
1
answer
153
views
Is this contact form code breaking any rules?
Can you please review my PHP script below? It is for a contact form. Am I breaking any rules? Does it seem okay to you?
...
3
votes
2
answers
2k
views
Copy object properties without using many if statements
I have two class:
InputForm.java
...
3
votes
2
answers
17k
views
Using JavaScript to add and delete rows from an HTML 5 form
I am a JavaScript beginner. Here's a fictional example which isolates the functionality mentioned in the subject line. I hope to employ this functionality as part of a larger web application in the ...
3
votes
2
answers
237
views
PHP Validation with functions and list()
I have multiple form validation checks around my site so I decided to write them as functions to simplify the process of creating the validation pages, here is a snippet for an understanding of what I'...
3
votes
2
answers
4k
views
PHP Questionnaire Code Peer Review
I just started learning how to code PHP as well as HTML and as a challenge for myself I put together a questionnaire with what I have learnt so far which isn't as much as I would like to know e.g. ...
3
votes
3
answers
438
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 ...
3
votes
1
answer
222
views
jQuery autocomplete for all place names in the UK
I made an autocomplete input box of every town, city and village in the UK. Yes, every single one. The load times are painful so is there a way to reduce that?
Here is a sample:
...