Store value in a computed field

I have a textfield,multivalue.What I want is that on the sort of table(a javascript code is written for that) I require to store a value(which is the id of the table) in a compued field.It will go on adding it in the text field.Suppose user sorted table 1.In the text field it will store table 1.After that user sorted table 2.The text field now have table 1,table 2.How can I do that?Please help.

Subject: store value in a computed field

Hi,

I tried the following coding, it is working fine. Just try and let me know.

var frm=document.forms[0];

if (frm.sam.value == “”)

{

frm.sam.value= “Table1”

}

else

{

frm.sam.value = frm.sam.value + “\n” + “Table2”

}

Regards,

Anita Elizabeth