An HTML form is a section of a document containing normal content, markup, special elements called controls and labels on those controls.

learn more… | top users | synonyms

3
votes
2answers
45 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
46 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
56 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
3answers
77 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
67 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 ...
2
votes
2answers
28 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
50 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
48 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
58 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
201 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
420 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
55 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. ...
2
votes
0answers
75 views

Immediately send redirect response, preserving session data

This question is for Laravel 4 only, as the relevant parts are completely refactored in the upcoming Laravel 5. I have written an helper function for validation, so I only have to put this in ...
1
vote
0answers
393 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, ...
3
votes
3answers
275 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 ...
1
vote
1answer
105 views

Reusable library to alert user of potentially unsaved changes

I wrote a small reusable component based of some of the examples to this question on Stack Overflow about Activating OnBeforeUnload only when field values have ...
0
votes
1answer
52 views

Best way to implement j_security login

I have a j_security login implemented but it's been giving me a lot of problems and wanted to know if there's anything that sticks out as incorrect or outright ...
3
votes
2answers
48 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 ...
2
votes
0answers
139 views

Simulate the way that PHP receives the form

Let's say I have this form: ...
3
votes
1answer
86 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 ...
1
vote
1answer
71 views

Book database for a library system

I am writing a book database, and ultimately a library system, in Django. When a book is created without a title set, the ISBN will be used to automatically fetch book data from WorldCat I have just ...
2
votes
1answer
120 views

Create a state dropdown with an abbreviation option and a full option

I have this simple function here because I am too lazy to write out a state dropdown every time I need one. I already have an array with all the states set up, abbreviations as keys and names as ...
14
votes
2answers
1k views

Is this form submission validator professional?

I have written some jQuery code for AJAX form submission: ...
1
vote
1answer
124 views

Refactor Coffee Script to fire on page load instead of change

I have a Rails app where I'm trying to select a list of facilities based on what region is selected in a form. So far, I've implemented group_collection_select to do this as well as a bit of ...
2
votes
1answer
56 views

Spree Billing/Shipping Address Checkbox

I used JS to re-populate the shipping address into the billing address when a checkbox is clicked. I'm wondering whether there is a more concise/better way to write the code below: ...
3
votes
1answer
75 views

RESTful workaround

I met the RESTful ideology and I fell in love with it. However the only request methods supported by HTML forms so far are GET and ...
2
votes
1answer
50 views

Form data handler class

I've started to write a form data handler class in PHP. Can you please review it and point out any mistakes or logic errors, or perhaps if a method can be written in a better way? ...
7
votes
1answer
892 views

PHP Form Builder Class

I would like my form generator class to be reviewed. I want to know about the following topics: Is this efficient? Does this have any flaws? Is this using the concepts in the proper way? Are there ...
5
votes
1answer
81 views

List files and download

The following code list all files in a folder and allows the user to download one of them. It is working but I think it could be done better. Is there a way to reduce the number of forms to only one ...
2
votes
0answers
682 views

Ember.js file upload code

I am a newbie and tried to find the laziest way to do a file upload using EmberJS, jQuery and formdata (IE10+). The code might look stupid, but it worked. Can you please take a look and give some ...
3
votes
2answers
239 views

POST security with PDO?

So I have some code that works as PDO. But is it secure? I'm trying to prevent SQL injection. This is my first PDO script and was hoping to see if it was done correctly. Here it is. ...
3
votes
2answers
363 views

Form with a country list statically or dynamically generated

I want to create a form with a country drop down list so I can just google and get all the countries but the question should I just encode it statically or generate dynamically with PHP. (Note it ...
3
votes
1answer
283 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: ...
5
votes
1answer
691 views

Live updating headers from form input with React.JS

I am teaching myself React.js from Facebook with small projects. For this one, I want to know if this was the cleanest, most React-ish way I could have done this. The basic structure is as follows: ...
3
votes
2answers
149 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. ...
5
votes
2answers
194 views

Possible security issues in email validation

I need feedback on this code regarding security issues. ...
10
votes
6answers
2k views

Can people understand my form validation code?

I've just finished creating this form validation but I want to make it public for beginner 'contact us forms'. I was wondering if I can have some peoples' input on if they can understand/read my ...
4
votes
1answer
199 views

Form Validation Evaluation

I've been trying several styles of validation code for a form. I was wondering if this is good or needs some improvement or just trash it and use jQuery validator code? ...
15
votes
6answers
1k views

Login Form in HTML

I am a beginner and I have made Login Form in HTML. I'm pretty sure it will look horrible to any developer, but hey, that's why I've posted it. I'd like a general review of this. I'm especially ...
3
votes
3answers
106 views

Password hashing/handling on a form

Does my code look secure right now? I know that I still have the password hashing and so forth, but what about SQL injections? Do I have any? Are there any other security issues? ...
1
vote
1answer
89 views

Optimized Form fields generating class

I am building an application full of forms and so I thought it is good idea to create a class to populate form fields. Here is my class and I am sure it can be optimized more than now and could be ...
4
votes
1answer
153 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 ...
1
vote
1answer
72 views

Eliminate nested HTML elements for jQuery animation?

Background When a user leaves a page, if they haven't submitted form data, a button is animated to draw the user's attention. (This is a poor UX choice--all the form data should be submitted--but it ...
7
votes
2answers
140 views

How to DRY up my forms.py?

I have two ModelForms that are the same, except that one of them has its form layout built in a view and one has a submit button. These are pretty long and I have a ...
5
votes
1answer
94 views

Form generator for inputting URL, description and link

This is a form generator I created so users can input a URL, description and link. The output will eventually be a JavaScript news slider. The HTML the form generated is irrelevant for now but I'd ...
9
votes
2answers
4k views

Reservation Form in HTML

I am a beginner and I have made a Reservation Form in HTML. I'm pretty sure it will look horrible to any developer out there, but hey, that's why I've posted it. I'd like a general review of this. ...
4
votes
2answers
466 views

Checking login from associative array vulnerabilities

For a very simple databaseless website, I'm using an associative array to store logins like this: ...
3
votes
1answer
122 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? ...
6
votes
1answer
81 views

Account-Creation form

How can I optimize the following PHP/JS code? It works like a charm but I think it is too long and I'm sure it could be optimized. If I have another form, I'll need to copy paste some lines from my ...