Inline editing with jquery
How do I make an inline editing with jquery?
Transform the content of a table into textarea and save the value.. What is a inline editing with jquery? How do you make a inline editing with jquery? This script and codes were developed by Gabriel on 18 July 2022, Monday.
Inline editing with jquery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>inline editing with jquery</title> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script src="//code.jquery.com/jquery.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ .container { margin-top: 15px;
}
#save, .info { display: none;
}
.info { color: #999;
}
textarea { width: 100%; min-height: 100px; resize: vertical; margin: 0; padding: 2px;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="container"> <h1>inline editing <small>with jquery & textareas</small></h1> <table class="table table-bordered"> <thead> <tr> <th>Field 1</th> <th>Field 2</th> <th>Field 3</th> </tr> </thead> <tbody> <tr> <td>At vero invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua</td> <td>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor</td> <td>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egesta</td> </tr> </tbody> </table> <button class="btn btn-info" id="edit"><span class="glyphicon glyphicon-edit"></span> edit</button> <button class="btn btn-success"id="save"><span class="glyphicon glyphicon-save"></span> save</button> <span class="info">(here you can do some ajax action...)</span>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Inline editing with jquery - Script Codes CSS Codes
.container { margin-top: 15px;
}
#save, .info { display: none;
}
.info { color: #999;
}
textarea { width: 100%; min-height: 100px; resize: vertical; margin: 0; padding: 2px;
}
Inline editing with jquery - Script Codes JS Codes
$('#edit').click(function(){ $('#edit').hide(); $('td').each(function(){ var content = $(this).html(); $(this).html('<textarea>' + content + '</textarea>'); }); $('#save').show(); $('.info').fadeIn('fast');
});
$('#save').click(function(){ $('#save, .info').hide(); $('textarea').each(function(){ var content = $(this).val();//.replace(/\n/g,"<br>"); $(this).html(content); $(this).contents().unwrap(); }); $('#edit').show();
});
Developer | Gabriel |
Username | gab |
Uploaded | July 18, 2022 |
Rating | 4 |
Size | 2,576 Kb |
Views | 40,480 |
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 |
LocalStorage Test | 2,927 Kb |
A clicking cookie gaaaame... | 16,067 Kb |
Image rendering | 2,422 Kb |
Replace a not existing img | 2,026 Kb |
Css3 background-clip | 2,090 Kb |
Picture overlay | 2,450 Kb |
Font awesome Hamburger-Menu-Toggle | 2,191 Kb |
CSS3 Login | 3,115 Kb |
Cool toggle with filling effect | 2,499 Kb |
Animated Trash Icon pure CSS | 3,853 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 |
Comment Jquery | SquishyAndroid | 2,421 Kb |
Tic Tac Toe | Volv | 4,862 Kb |
Animated skewed panes | NyX | 4,462 Kb |
A Pen by Andrea Verlicchi | Verlok | 2,018 Kb |
Search Box in Content Moves to Fixed Header | Chriscoyier | 2,768 Kb |
Midterm dry run | Jds317 | 1,649 Kb |
Parallax scrolling scene | Iharosi | 2,485 Kb |
About Mazano | Kiti | 2,585 Kb |
Project Euler Problem 17 | Bfillmer | 2,739 Kb |
Simple Linear Regression with Editable Table | Melatonind | 3,264 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!