So let's change the question a bit.
I have a dom element like a table with many input boxes and selects
insides. When filling the input values and selecting elements in the
select box the dom object is with
the updated values , but the innerhtml is like it was loaded. i want a
function which takes a dom element and returns the html
for example if i had a input filed a and i entered the value david, i
want that the function will return <input name="a" value="david">


On Jul 14, 3:05 am, Charlie <[email protected]> wrote:
> still not sure if this is 2 tables and exactly what you are trying to do,
> david wrote:Dear Charlie, I mean if i have a table <table> <tr> <td> <input 
> type="text" value="" name="a'> </td> <td><input type="text" value="" 
> name="b"> </td> </tr> </table> and then i enter in a david and b michael i 
> want at the end <table> <tr> <td> <input type="text" value="david" name="a'> 
> </td> <td><input type="text" value="michael" name="b"> </td> </tr> </table> 
> The same i want also for selected. Is there a way to make it ? Thanks, David 
> On Jul 13, 12:02 am, Charlie<[email protected]>wrote:I think I confused 
> myself and not sure what objective is....oh well, was good practice Charlie 
> wrote: After rereading this,  if tables are same size and  same config;  the 
> following clones the existing table and strips out all inputs inserting the 
> values as text in new table $("#originalTable").clone(function () {        
> $("#originalTable").clone().appendTo("body").attr("id","newTable");        
> $("#newTable td").each(function () {              var newText = 
> $(this).find("input").val(); // get value from input             
> $(this).html(newText); //replace input with new html which is just text       
>         }); Working examplehttp://jsbin.com/uroca Charlie wrote:this isn't 
> exactly clear but sounds like you are taking input values and want them as 
> straight text in a <td> of the new table? how you go about this will depend a 
> lot on the size and structure you have for markup as well as how much of 
> original goes into new table. Could be as simple as clone() of the original 
> table, and a $each for the td's to strip the inputs and change them to text 
> then remove rows or columns. Very hard to guess what "part of the output" 
> means. There are numerous methods, clone original ,indexing, working with 
> classes or ID's to  append  to new table. Posting a sample page of old and 
> new with a little more detail on your requirements would make solutions a lot 
> easier to identify. If can't post on server jsbin.com is excellent for this 
> david wrote:Hi all, I have a table of input elements which i create through a 
> javascript widget. When i press submit i want to make an action and a part of 
> the output should be the same unchanged tables with the values in it. I don't 
> know how to accomplish it. At first i used the html() function, but it does 
> not pass the table with the html values inserted as i would like. Has anyone 
> an idea how to make it ? Thanks, David

Reply via email to