Inline editing with jquery

Developer
Size
2,576 Kb
Views
40,480

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 Previews

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();
});
Inline editing with jquery - Script Codes
Inline editing with jquery - Script Codes
Home Page Home
Developer Gabriel
Username gab
Uploaded July 18, 2022
Rating 4
Size 2,576 Kb
Views 40,480
Do you need developer help for Inline editing with jquery?

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!

Gabriel (gab) Script Codes
Create amazing love letters with AI!

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!