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
1
vote
0
answers
257
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.
...
1
vote
0
answers
592
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
vote
0
answers
28
views
jQuery plugin for allowing only digits to be entered in html form input
I wrote this small jQuery plugin to set some fields so that they allow only 0-9 digits to be entered.
I intended to do that by preventing user from typing, pasting or dropping non-digit content.
It ...
1
vote
0
answers
369
views
React form to add contacts to an app
I was recently building a form to add contacts to a play app I'm making and I finally got it to work. The problem is I'm not too happy with it.
It's my first time building an application with React, ...
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 ...
1
vote
0
answers
3k
views
React: Simple Event Emitter on form example
I decided to study EventEmitter and play around with it in React JS for on example of a simple form.
I built EventEmitter and added event 'newdata' to it. On event 'newdata' is called function where ...
1
vote
0
answers
2k
views
Autosave reactive forms
I'm building an autosave for a data driven form on Angular.
Here is our code snippet:
...
1
vote
0
answers
2k
views
Populate country-province-city dropdowns from Firebase query
I'm new to Firebase and am a recovering SQL developer, so I haven't quite wrapped my mind around all aspects of firebase querying. I have an app that has basic functionality in place, but some aspects ...
1
vote
0
answers
450
views
Populating an HTML table with JSON results
Could anyone suggest a better approach than the one I'm using now? I tried to keep it as minimal as possible, but this is the best I came up with. I did extensive research just to get to this point.
...
1
vote
0
answers
253
views
JavaScript to add interactive functionality to a conference registration form
This is some simple JavaScript to add interactive functionality to a form. I'm trying to make it unobtrusive for non-JS users.
...
1
vote
0
answers
424
views
POJO-based PDF form filler
I'm pretty new to Java development and have written a little POJO to "PDF Form Filler" program. I'd be interested in recommendations and suggestions about coding style, used methods and classes and so ...
1
vote
0
answers
75
views
Inserting non-empty form values into database
I have a form that I submit and returns me about 500 rows. Before inserting into table I check the strings are not null. This means it loops all the strings.
Is there a better way that it doesn't ...
1
vote
1
answer
240
views
Identical jQuery autocomplete handlers for two form fields
I do need to use jquery autocomplete for two inputs. But I have use same processing script for these two elements.
At this stage I am doing it like this.
...
0
votes
2
answers
143
views
ListFind test conditions
I am considering
...
0
votes
1
answer
2k
views
On form inputs focus, show div. hide div on blur for multiple inputs and hidden divs
I posted a question on Stack Overflow and got an answer that works but has a lot of duplicated code. In the future, the functionality may also require a third or more divs to be shown or hidden. The ...
0
votes
1
answer
135
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?
...
0
votes
3
answers
152
views
Support for an interactive form with multiple tabs
I just failed in a JavaScript test and I would really appreciate some comments of how I can improve so I can keep learning.
The test was about making a form interactive, where the code should do ...
0
votes
1
answer
233
views
React component wrappers for form fields with 90% similar code
I have a number of these components, but will show just two as an example. They're very similar, but the differences are enough to where splitting them out felt needed. What I really need is some help....
0
votes
2
answers
418
views
Submitting a form via JSON
I have a file named feedback.js that I would like to improve.
...
0
votes
1
answer
199
views
Configuring a date picker with support for disabled dates
I'd like to see if I can somehow make this loop more effective (smaller?). I'm using MultiDatesPicker to make a reservation plugin. And I've set everything right, and everything works, but I'd like to ...
0
votes
1
answer
69
views
Range slider show/hides and reset (vanilla js)
I have a HTML5 range slider. i.e. ...
0
votes
1
answer
654
views
Preparing form data for a POST request with fetch
Acquiring a form’s data for asynchronous POST requests has been a long-standing problem. There is the FormData API, but there are still some obstacles when the form’s data is encoded as ...
0
votes
2
answers
64
views
jQuery function to display an alert when submitting blank fields
I am new to jquery and implemented following function in a js file in case of error-
...
0
votes
1
answer
121
views
Writing cleaner PHP code to add additional options
I have a contact form that will perform validation on the server. Right now the form checks if the fields are empty or not. My goal is to expand it following:
Check the fields for particular format, ...
0
votes
1
answer
41
views
JS OOP Form Module to add sibling select elements
How can it be more cross-browser compatible, robust, better performance if possible?
...
0
votes
3
answers
5k
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. ...
0
votes
1
answer
46
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
3
answers
44
views
Control of empty fields in a form via JavaScript [closed]
I would like to know if it is safe enough to create via JavaScript control of empty fields. Here is my example in detail:
...
0
votes
1
answer
50
views
Changing sales stage
I think this code is not optimized:
...
0
votes
1
answer
1k
views
Resizing table widths and making input fields
I am trying to simplify my code, which will do several things:
Give the same width to every columns no matter how many columns the table has.
Add input field if there is no text inside a ...
0
votes
2
answers
114
views
Form involving several models related to each other
I have a form that I feel I am overcomplicating because of the relationship between models that are involved. Can you let me know if there's a more elegant solution to what I have?
(for reference) ...
0
votes
1
answer
4k
views
Change URL on select change
I've made a method, which inserts a new query parameter, when the value of a select changes, then reloads the page. I've had enough of URL jQuery hax, so I figured it would be a great idea to put the ...
0
votes
0
answers
45
views
Unit test for a registration form using C# and Selenium
I would like to know if the below code written in C# Selenium to do Unit Test is efficient and readable. Is there any particular way to do Unit Test. Else suggest me where I can learn to do better ...
0
votes
0
answers
18
views
best way to check if every part of a stepper is valid and emit an event then
I want to check if each part of my multipart form is valid inside my stepper component, if it's the case I intend to emit an event that can be handled by the parent component.
To do this, I have made ...
0
votes
0
answers
24
views
Simple Todoesque React Component for selecting Multiple Choices in a form
I was recently pinged about a quiz app a friend of mine was building with React Native for fun they were having minor brain farts over handling a multichoice answer template and asked me to look over ...
0
votes
0
answers
26
views
Custom duration input component
I would love some pointers in terms of clean code, performance and maybe edge cases that I missed.
Component Template
...
0
votes
1
answer
106
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 ...
0
votes
2
answers
294
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:
...
-1
votes
1
answer
312
views
jQuery button click handler to fill in form fields [closed]
I have this function and not quite sure how to optimize it?
...
-2
votes
1
answer
82
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:
...