View Single Post
Old 10-01-2011, 12:42 PM   PM User | #7
Starholdest
New to the CF scene

 
Join Date: Oct 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Starholdest is an unknown quantity at this point
Tested this just as you described in Chrome/FF...still same thing. What works for you exactly?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>

<script>
var original;

$(document).ready(function() {
$(".info").click(function() {
original = $(this).html();

var textarea = '<div><textarea name="comments" cols="60" rows="3">' + $(this).html() + '</textarea>';
var button = '<input type="button" value="Save" class="saveButton" /> OR <input type="button" value="Cancel" class="cancelButton" /></div>';

$(this).after(textarea+button).remove();
});

$('.cancelButton').live('click',function() {
$(this).parent().parent().html('<div class="info">' + original + '</div>');
$(this).parent().remove();
});
});
</script>

<style type="text/css">
</style>
</head>

<body>

<div class="info">This is a test</div>

</body>

</html>
Starholdest is offline   Reply With Quote