I am new to ruby on rails and twitter bootstrap. Accept my apologize if my question sound dumb. I am using twitter bootstrap for my site design. I have been trying to use b
Use a hidden input
When user click on "Edit", grab the text from text-info (eg Saghir), hide the label, show the input and set the inputs placeholder-attribute.
function edit(element) {
var parent=$(element).parent().parent();
var placeholder=$(parent).find('.text-info').text();
//hide label
$(parent).find('label').hide();
//show input, set placeholder
var input=$(parent).find('input[type="text"]');
$(input).show();
$(input).attr('placeholder', placeholder);
}
working fiddle : http://jsfiddle.net/TKW74/