Skip to Content
0
Former Member
Mar 19, 2004 at 07:52 PM

Calling javascript within tableview model

40 Views

Hi,

I am building a table using HTMLB. I need to call a javascript function within a <td>. The javascript formats the date. While adding to the Vector I add the cell content as

row.addElement("<script language=\"javascript\">dwColDateTime(new Date("date"));</script>");

Where date is a string.

In my JSP I have the following javascript function

<script language ="javascript">

function dwColDateTime(dt){

fdate = new Date(dt.getTime() + zonediff);

document.write(fdate);

}

</script>

When my table shows up, it shows the content of <td> as it is ie,

<script language="javascript">dwColDateTime(new Date(2004,2,19,08,45,0));</script>

Without HTMLB the javascript works fine.

How do I call the javascript function from within my cell in TableView?

Any ideas will be highly appreciated.

Thanks

lakshmi