Snippets tagged “forms”
76 snippets use this tag.
- Ajax Upload imagePHP
To upload an image using Ajax, you can use the following steps:
- AngularJs Blocks Form Submit without "action"AngularJs
AngularJs Blocks Form Submit without "action"-In general, AngularJs blocks the form submit, because of empty "Action".
- Check if $_POST existsPHP
To check if the $_POST superglobal variable exists in PHP, you can use the isset() function.
- file upload php $_FILES undefined index errorPHP
The error "Undefined index: (name of the file input)" in PHP usually occurs when the form that is used to upload the file is not properly configured.
- Form Validation Using JavaScriptJavaScript
Incorrect information leads to bad user interactions. So as to prevent this problem, read and learn how to validate forms with the help of JavaScript!
- Getting all request parameters in Symfony 2PHP
In Symfony 2, you can use the $request->request object to get all request parameters.
- How can I select and upload multiple files with HTML and PHP, using HTTP POST?PHP
You can use the following HTML code to create a form that allows users to select and upload multiple files.
- How can I upload files to a server using JSP/Servlet?Java
To upload files to a server using JSP/Servlet, you can use the following steps:
- How do I PHP-unserialize a jQuery-serialized form?PHP
In PHP, you can use the unserialize function to unserialize a serialized string.
- How to Add an HTML Button that Acts Like a LinkHTML
There are several ways to place a clickable button on a webpage that will be linked to another page of your website. You can add inline onclick event to HTML button tag, or input tag.
- How to Align a Checkbox and Its Label Consistently Cross-BrowsersCSS
Checkbox is one of HTML forms that is used on every website. This tutorial will show how to align checkboxes and their labels consistently across browsers.
- How to Align Labels Next to InputsHTML
In this snippet, you’ll learn how to align <label> elements next to <input> elements. Align labels to the right and left of inputs by using CSS properties.
- How to Align the Placeholder Text of an Input Field in HTMLCSS
The ::placeholder pseudo-element allows styling the placeholder text of a form element. Here you will find out how to align an input field’s placeholder text.
- How to Apply CSS Style to the Element NameCSS
In this snippet, we’re going to demonstrate how you can apply CSS styles to the name of the element. For that, you can use attribute selectors. See examples.
- How to Assign a Checked Initial Value to the Radio ButtonHTML
In this tutorial, find out how you can assign a checked initial value to the radio button with HTML. To achieve that goal, you need to use the checked attribute.
- How To Change the Color of an HTML5 Input Placeholder Using CSSCSS
Learn How To Change the Color of an HTML5 Input Placeholder with CSS with W3docs tutorial. Try the code examples yourself. Fast solution.
- How to Change the Input and Button Images with CSSCSS
It may be difficult to style buttons, especially when we need to change them to images. You can change buttons to images with <input> and <button> elements.
- How to Check a Radio Button with jQueryJavaScript
Read the tutorial and learn the right way of checking a radio button with jQuery. Also, read how to handle with different versions of jQuery while checking.
- How to Check and Uncheck Checkbox with JavaScript and jQueryJavaScript
In this tutorial, you will read and learn about several JavaScript and jQuery methods for checking and unchecking a checkbox. Choose the best one for you.
- How to Control the Width of the <label> TagCSS
Since the <label> tag is an inline element, using the width property won’t have any effect. Here you can find some methods of adding width to the <label> tag.
- How to Create a jQuery Ajax Post with PHPPHP
Here, we will share with you how to create a jQuery Ajax post request with PHP. Just check out the examples and choose the one that suits your needs best.
- How to Create a Multi-Line Text Input Field In HTMLHTML
In this snippet, we’ll demonstrate how to create a multi-line text input field in HTML. Read this tutorial and see how this can be done with the <textarea> tag.
- How to Create a Placeholder for an HTML5 <select> Box by Using Only HTML and CSS?CSS
Learn how to make a placeholder for a select box. Use only 3 HTML attributes or CSS :invalid pseudo-class and the display property set to none.
- How to Create a Popup Form Using JavaScriptJavaScript
Read this JavaScript tutorial and learn how to create popup login, contact, multiple popup logins in one page and other forms on your website with examples.
- How to Create a Responsive Login Form in Navbar with CSSCSS
Apparently, all websites have login forms and millions of people log in every day. Create a login form in navbar for your website in an easy way using just HTML and CSS.
- How to Create Ajax Submit Form Using jQueryJavaScript
This tutorial provides several methods of creating an Ajax submit form using jQuery easily. Read about the differences of the GET and POST HTTP methods.
- How to Create Contact Form With CSSCSS
Create a contact form for collecting user’s contact details and opinions about your website. Follow the steps and create a contact form with CSS in a simple way.
- How to Create Custom Checkboxes and Radio ButtonsCSS
Learn how to create and style custom checkboxes and radio buttons. Also set custom images as checkboxes and radio buttons. See all with examples.
- How to Create Mailto FormsHTML
Learn about how to create a Mailto forms with examples. See also the advantages that Mailto forms can have.
- How to Create Search BoxesCSS
Create and style beautiful search boxes without any JavaScript code. Learn the steps to create search boxes and find lots of examples in this tutorial.
- How to Customize File InputsCSS
It is possible to customize the file input using a <label>. In this snippet, you’ll find the way of customizing the file input without using any JavaScript.
- How to Disable Form Fields with CSSHTML
In this tutorial, we’ll demonstrate how it is possible to disable form fields with some CSS. For that, you can use the pointer-events property set to “none”.
- How to Disable the Browser Autocomplete and Autofill on HTML Form and Input FieldsHTML
Learn how to prevent browsers auto filling the input fields of HTML forms. Use autocomplete="off" to specify that autocomplete is disabled. See examples.
- How to Disable the Resizing of the <textarea> Element?CSS
Use the CSS3 resize property with its "none" value to disable the resizing function of the textarea element. Learn the ways of only vertically or horizontally resizing, too.
- How to Get Multiple Selected Values of the Select Box in PHPPHP
Learn how to get multiple selected values of the selected box in PHP. In our snippet, we provide you with comprehensive information and handy examples.
- How to Get the Value of a Textarea using jQueryJavaScript
Read this tutorial and learn useful information about how you can detect the value of the HTML <textarea> element easily using one of the jQuery methods.
- How to Hide and Show a <div>JavaScript
Read this tutorial and learn several CSS, JavaScript and jQuery methods of hiding and showing the <div> element. Also, you can find examples and try them.
- How to Know which Radio Button is Selected using jQueryJavaScript
Read this JavaScript tutorial and learn the method of getting the value of the selected radio button with the help of jQuery. Copy the code right away.
- How to let PHP to create subdomain automatically for each user?PHP
To automatically create a subdomain for each user in PHP, you can use the following steps:
- How to Make the Content of Input Start from the RightCSS
Sometimes, you may need to make the content (such as a text or number) of input start from the right. Read and find out what properties to use for that.
- How to Make the Text Input Non-EditableHTML
In this snippet, you can find two methods of making a text input non-editable. Use either the HTML “readonly” attribute or add the CSS pointer-events property.
- How to Match an Empty Input Box with CSSCSS
It is possible to match an empty input box only if the input field is required. In this snippet, we’ll show how to do this using the CSS :valid pseudo-class.
- How to Prevent Tab Indexing on Specific ElementsHTML
In this snippet, we demonstrate how it is possible to prevent tab indexing on specific elements. Read our tutorial to find out the answer and also try examples.
- How to Read Whether a Checkbox is Checked in PHPPHP
In this tutorial, you can find comprehensive information on how to read whether a checkbox is checked in PHP.
- How to Remove and Style the Border Around Text Input Boxes in Google ChromeCSS
Use outline: none to remove the ugly border color for a form field in Chrome. Learn also how to give your own style for showing that the box is active. All with examples.
- How to Reset File Input with jQueryJavaScript
In this tutorial, you will read and learn useful information about the fastest method of resetting a file input by using some HTML and jQuery methods.
- How to run a PHP function from an HTML form?PHP
To run a PHP function from an HTML form, you will need to create an HTML form with the desired inputs, such as text fields and submit buttons.
- How to Set a Minlength Validation in HTML5HTML
In this snippet, find out what alternative attributes to minlength can be used to set a minlength validation in HTML5. Read our snippet and try examples.
- How to Set Default HTML Form Focus Without JavascriptHTML
In this tutorial, you’ll see how to set the default HTML form focus. This can be done without Javascript. For that, use the HTML “autofocus” attribute.
- How to Set the Size of the <textarea> ElementHTML
In this tutorial, you will find two ways of setting the size of the HTML <textarea> element. For that purpose, you can use HTML attributes or CSS properties.
- How to store file name in database, with other info while uploading image to server using PHP?PHP
To store the file name in a database along with other information while uploading an image to a server using PHP, you can follow these steps:
- How to Style a Checkbox with CSSCSS
Checkbox is one of the HTML forms used on every website, but mostly they are not styled and look the same. If you want to make your site more attractive for users, you can simply style your checkboxes. If you don’t know how to do that, now we will create
- How to Style Comment Box Using CSSCSS
Style comment boxes, change the background color, add a background image or set borders to your comment box. See all with examples.
- How to Style Input and Submit ButtonsCSS
In this snippet, you will find out how to style input and submit buttons easily. Use various CSS properties to achieve this goal. Read the snippet and try examples.
- How to Use the "required" Attribute on the <select> Element in HTML5HTML
The “required” attribute works only on empty values. In this snippet, we’ll show how to apply it to the HTML <select> element. Read and find some examples.
- How to Use the "required" Attribute with the Radio Input FieldHTML
Read this snippet to find out how you can use the “required” attribute with the radio Input field. Here, you can also find an example and try it yourself.
- How to Use the HTML <fieldset> TagHTML
In this tutorial, you will find some examples of using the HTML <fieldset> element. Besides, you can find out why in general we need the <fieldset> element.
- How to Use the HTML accept AttributeHTML
In this tutorial, we’ll explain what is the HTML accept attribute and why it is used. Use this attribute to specify file types the user is allowed to choose from.
- How to Validate an E-mail Using JavaScriptJavaScript
Read this tutorial and learn a fast and easy solution to the issue of validating an email using JavaScript. Also, you will read about what the email is.
- How to validate Google reCAPTCHA v3 on server side?PHP
To validate a Google reCAPTCHA v3 on the server side using PHP, you will need to do the following steps:
- HTML/PHP - Form - Input as arrayPHP
To create an HTML form that submits an array as a form parameter, you can use the name attribute of the input element and give it a value in the form of an array.
- Input Types for HTML FormsHTML
Learn about mostly usedLearn about mostly used input types which are used when creating HTML Forms. See Syntax and examples. input types which are used when creating HTML Forms. See Syntax and examples.
- Is It Possible to Nest an HTML <button> Element Inside an <a> Element in HTML5CSS
In this snippet, learn whether it’s possible to nest a <button> tag within an <a> in HTML5. To have a button linking to somewhere, you need an alternative solution.
- Laravel csrf token mismatch for ajax POST RequestPHP
The csrf_token error you are encountering occurs when you are making a POST request to your Laravel application and you have not included a valid CSRF token in the request.
- PHP code to get selected text of a combo boxPHP
To get the selected text of a combo box (also known as a dropdown menu or select box) in PHP, you can use the following code:
- PHP form - on submit stay on same pagePHP
To stay on the same page after a form submission in PHP, you can use the following steps.
- posting hidden valuePHP
In PHP, you can post a hidden value by including it in a hidden input field within a HTML form.
- Send html form data to sql database via php (using mysqli)PHP
To send HTML form data to a SQL database using PHP, you will need to use the mysqli (MySQL Improved) extension in PHP.
- Send value of submit button when form gets postedPHP
In PHP, you can access the value of a submit button when a form is posted in the following way:
- Simple PHP calculatorPHP
Sure!
- submit a form in a new tabPHP
To open a form submission in a new tab, you can use the target attribute of the form element and set it to _blank.
- Submit html table data with via form (post)PHP
Here is an example of how to submit an HTML table data via a form (using the POST method) using PHP:
- The CSRF token is invalid. Please try to resubmit the formPHP
This error message is typically related to a security feature called "Cross-Site Request Forgery" (CSRF) protection.
- What is the Difference Between the "id" and "name" AttributesHTML
In this snippet, we’re going to discuss the differences between the “id” and “name” attributes, after which you’ll make a better decision of their usage.
- Which is the Float Input Type in HTML5HTML
In this tutorial, you’ll learn which is the float input type in HTML5. Read our snippet and try some examples with the step value to see the solution to this problem.
- Why and How the Bootstrap sr-only Class is UsedCSS
In this snippet, you can learn about the sr-only class and see how it is used in Bootstrap. To find more information, read our snippet and try examples.