i want to have a table of select dropdowns and when you click "commit" all of the selects will simply be regular text inside the of the table. do i have to put the select inside of a div and remove and replace with raw html?
views:
24answers:
1
+3
A:
You could merely replace each select
with the text-version of their present value:
$(function(){
// user clicks any 'commit' button
$(".commit").click(function(){
// find all select menus in same table-row
$(this).closest("tr").find("select").each(function(){
// convert to regular text
$(this).replaceWith( $(this).val() );
});
});
});
Online example: http://jsbin.com/oleda
Jonathan Sampson
2010-01-14 21:19:29