An HTML form is a section of a document containing normal content, markup, special elements called controls and labels on those controls.
3
votes
1answer
64 views
Simply implementing a repeating HTML form with a total
Since the repetition mode didn't make to HTML5, I was wondering how to succinctly implement it in Javascript. I've already spent a few hours on this jsbin. Be great to get a review.
...
3
votes
2answers
70 views
Simple web form in PHP
This is a simple web form handler in PHP that sends a completely filled web form to a email.
I see lots of repeating code. What is the best way to reduce repetition?
Is my way of checking for fields ...
3
votes
1answer
86 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
1answer
33 views
Style-changing handler for an HTML drop-down box
How can I maybe do some loop that will compress the amount of JavaScript/jQuery I need to use. I have a function s3episodesChange() linked to a ...
11
votes
1answer
128 views
Early Access: Dynamically expanding input element table
This code is in a really early state in the lifecycle. I'm still in the process of implementing some core features, but nevertheless the code up to here works and accomplishes its task.
I have no ...
6
votes
2answers
280 views
Updating the presentation of a credit card field as the card type becomes known
The goal here is to, add a credit card image, and remove all other credit card images, of a certain input field.
I had a even larger code, with a lot of addClass() and removeClass()... then, I shrink ...
6
votes
1answer
99 views
UI selector directives for an AngularJS invoicing module
I'm wrapping ui-select in my own directives to pre-configure and style it, as I need it for my app in different select widgets. They appear on many pages, for example ...
4
votes
1answer
43 views
Limiting the number of text fields created
I need to make sure that the max of text fields created is limited to 10 at most.
It's a script that I've ripped off elsewhere, and have modified it via help from StackOverflow on a couple of other ...
2
votes
2answers
81 views
Registering usernames and passwords to a database
Here is my script that registers a user to a database. I am still very much a newbie when it comes to this topic so any guidance would be greatly appreciated.
...
3
votes
2answers
154 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
1answer
124 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 ...
2
votes
2answers
41 views
Model object for form validation
In order to perform form validation, I have created a custom object:
...
4
votes
2answers
337 views
Upload a photo with a unique name using PHP
I have written a script for basic uploading of a single image to a web server using PHP. This is an example that is intended for educational purposes in a basic PHP course. It does not take extensive ...
4
votes
1answer
50 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 ...
3
votes
1answer
66 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 ...
9
votes
5answers
355 views
Prorated Refund Calculator (v2)
This is a follow-up question to original Prorated Refund Calculator. Here is the summary of the changes I made since last, thanks to the good answers and some study of my own.
Did away with ...
4
votes
1answer
62 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 ...
5
votes
2answers
49 views
PriceDialog - Prompt & price validation
In a recent CodeReview I presented a Product Manager that manages product listings and prices. Based on the great feedback I have refactored the mentioned Prompt and validator class and want feedback ...
1
vote
3answers
149 views
Partial view for frequently used drop down lists
I have one input that is needed in many forms, so I created a partial view for that. In the partial view I query the database and generate a drop down list.
I just want to make sure, this is the best ...
4
votes
1answer
73 views
Generate form and append to the body
I'm writing a plugin and want it to have no dependencies. I create a form and append it to the page, but the code is really long. Does anyone have any suggestions to clean it up, perhaps shortening ...
3
votes
2answers
119 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 ...
10
votes
2answers
643 views
Checking all checkboxes
Problems:
Wanting to check all checkboxes when the checkbox w/id=checkall is checked.
Wanting to uncheck the "checkall" box when any other checkbox is unchecked.
Solution:
...
2
votes
2answers
253 views
jQuery range slider change text based on hidden field value
I am working on a jQuery ratings function that uses the Foundation range slider. My current implementation works correctly on 2 of 7 of my range sliders. However, I am quickly realising that my ...
5
votes
1answer
1k views
Submit an array as html form value using JavaScript
I'm sending data from a form with a variable number of fields via an ajax call. Some of the fields are grouped together so I have opted to send them as an array of JSON objects to keep the groupings ...
0
votes
1answer
120 views
Processing selected and deselected elements
I think that this code is very bad because it does not agree with DRY principle. Can you advise me how to improve it?
...
4
votes
1answer
74 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
2answers
231 views
CheckChanged event readability
I have a CheckChanged method that I would like to improve as it takes a lot of space in my program and really hurts readability.
The method prompts the user for ...
1
vote
1answer
54 views
Multiple form inputs droppable
I have a form with 11 inputs that relate to each column on a table, which is displayed above. Each input has an id that matches the a class in the table based on the column name. I want all the inputs ...
4
votes
1answer
40 views
Handler for a screencast submission form
I have a monolithic script that powers this form:
Here it is:
...
1
vote
2answers
100 views
Making datastore inserts with Google App Engine and WTForms
I have a class for making datastore inserts with Google App Engine and WTForms. Now I want to refactor it into smaller units but I'm not sure how to do it. Can you help me find what needs to be done? ...
5
votes
1answer
1k views
Working with group of checkboxes in MS Excel
I have the following checkbox as depicted by the image below:
The checkboxes are in 3 groups. Confidentiality, Integrity ad Availability. When the first in is clicked, the Confidentiality turns Red ...
5
votes
1answer
238 views
jQuery Datepicker Plugin
I created a jQuery plugin that converts a text field to a 3 drop down, datepicker. It allows the user to select a Day, Month and Year rather than type the date in an input box.
The original input ...
1
vote
1answer
355 views
Meteor Form Submission
I am hoping a Meteor guru can please review my code below and verify if I am properly using return false and ...
3
votes
1answer
111 views
Form builder class
I am trying to learn OOP in PHP. My PHP knowledge is pretty good, but haven't tried OOP before. I'm currently building a formbuilder class. Can you take a look and tell me if this is the right way?
...
1
vote
1answer
32 views
PHP form to database fit for purpose
This code is intended to take input from a form and append it to a database table. The same data is sent to a separate function for subsequent mailing to the respondent. I'm self-taught and it works ...
1
vote
0answers
30 views
Form valid combinations from CSV selection options
I am building a form with multiple select option fields. I am trying to only show the next field if it exists as a combination in the CSV file I am reading in. It's working fine right now and I am ...
3
votes
2answers
179 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 ...
5
votes
1answer
192 views
Script to upload CV with cookie control
I have created a script which presents a popup on every 5th pageview.
I would like to try to use just PHP cookies. However, due to the requirement of setting them before any content is output, it ...
2
votes
1answer
78 views
Getting duration between two dates
I'm developing on a web application where I have a start and a finish date and time and have to set the duration between it.
There are inputs for dates and times.
Then, I have this function which ...
2
votes
4answers
203 views
Returns an array of all inputs with specified name
I've made a nice little function to return a NodeList array containing all the inputs that have a specified name attribute:
...
3
votes
1answer
147 views
Checking checkboxes
I wrote this code for checking checkboxes. There are two groups of checkbox: each group's checkboxes have one common class all_perks and one individual class ...
3
votes
3answers
86 views
Validating conditions for enabling sign-up button
On an authentication view, there are some inputs, like password, email, etc and a sign up button which is enabled only if theses inputs are not empty.
So what I have is this function:
...
2
votes
3answers
135 views
8
votes
2answers
2k views
How much is 2 + 2?
I'm currently working on a kind of PHP Quiz about mathematical calculations. We show a mathematical equation, and user need to input his answer.
Currently, this is what I have written:
...
2
votes
0answers
141 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 ...
0
votes
0answers
297 views
Using CasperJS to fetch and fill option values
I use the following CasperJS code to fetch data from an ASPX page with combo drop down box, which option values are dynamically populated via __doPostBack().
the ...
3
votes
1answer
308 views
HTML and CSS markup for flexible form layout
I'm trying to have a HTML / CSS structure for flexible layouts for forms. I tried to look at Bootstrap codes for help with this (without actually using Bootstrap itself). I've gone with something ...
10
votes
2answers
402 views
jQuery AJAX form using bad practice
I have not worked with jQuery for years so my knowledge of it is extremely limited. I wrote the following form and received a comment elsewhere saying:
This is some of the worst JavaScript I've ...
7
votes
7answers
808 views
Changing element visibility based on multiple checkbox states
I am writing a script in JavaScript & HTML and have some optimization problems. In the for, loop I check a variable named ...
4
votes
2answers
57 views
Rendering a selection box for 50 states
I was creating a Rails form where users have to enter their state. I ended up creating a select tag which is really, really ugly.
I'd like to think there's a better way of writing this.
...