Get Form value with jQuery
How do I make an get form value with jquery?
What is a get form value with jquery? How do you make a get form value with jquery? This script and codes were developed by Tommy on 30 December 2022, Friday.
Get Form value with jQuery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Get Form value with jQuery</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <a href="">button</a>
<form id="my-form"> <input type="text" name="my-text" value="This is text." />
<hr /> <input type="radio" name="my-radio" value="A" /> <input type="radio" name="my-radio" value="B" checked /> <input type="radio" name="my-radio" value="C" />
<hr /> <input type="checkbox" name="my-checkbox" value="A" /> <input type="checkbox" name="my-checkbox" value="B" checked /> <input type="checkbox" name="my-checkbox" value="C" checked />
<hr /> <select name="my-select"> <option value="A">This is A</option> <option value="B" selected>This is B</option> <option value="C">This is C</option> </select>
<hr /> <select name="my-multi-select" size="3" multiple> <option value="A">This is A</option> <option value="B" selected>This is B</option> <option value="C" selected>This is C</option> </select>
</form> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Get Form value with jQuery - Script Codes JS Codes
$("a").click(function() { // TEXT var valText = $('#my-form [name=my-text]').val(); console.log(valText); // => "This is text." // RADIO var valRadio = $('#my-form [name=my-radio]:checked').val(); console.log(valRadio); // => "B" // CHECKBOX var $checked = $('#my-form [name=my-checkbox]:checked'); var valList = $checked.map(function(index, el) { return $(this).val(); }); console.log(valList); // => ["B", "C"] // SELECT var valSelect = $('#my-form [name=my-select]').val(); console.log(valSelect); // => "B" // LABEL INSTEAD OF VALUE var valLabel = $('#my-form [name=my-select] option:selected').text(); console.log(valLabel); // => "This is B" // MULTIPLE SELCT var valMultiSelect = $('#my-form [name=my-multi-select]').val(); console.log(valMultiSelect); // => ["B", "C"]
});
Developer | Tommy |
Username | hoehoe |
Uploaded | December 30, 2022 |
Rating | 3 |
Size | 1,931 Kb |
Views | 6,072 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Flex box | 2,171 Kb |
A Pen by Tommy | 1,738 Kb |
CSS animation | 2,194 Kb |
CSS Sub-orderd list | 1,965 Kb |
Parallax with only css | 3,096 Kb |
Check box in Bootstrap Drop down list | 2,170 Kb |
Materialize css | 3,074 Kb |
Custom checbox with css | 2,825 Kb |
Timeline sample | 2,263 Kb |
Star Rates with radio buttons and CSS | 2,650 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Pruebas de d3.js | Juanmanuelcarnerero | 2,485 Kb |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Segments mouse following | Nosir | 2,909 Kb |
How to add Css Fold Notes In Blogger By Askwithloud.com | Askwithloud | 2,280 Kb |
LBCA - Mail canvas | Emnbdx | 3,856 Kb |
Social Profiles | Lachlanjc | 1,939 Kb |
Contact | GanNichiHa | 2,514 Kb |
Simple Flat Menu | Jeplaa | 2,467 Kb |
Ripples in water | Nobitagit | 2,704 Kb |
Off Canvas | Mariamarica | 1,870 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!