Forum Moderators: open

Message Too Old, No Replies

Dynamic creation of Calendar <script> with AddRow()

document.createElement('script');

         

chiponium

8:45 pm on Oct 6, 2006 (gmt 0)

10+ Year Member



Hello,
I need to be able to create a dynamic rows with a calendar in the text field that is being called from another javascript. Can this be done?

This is what I have:

var oCellScr = newRow.insertCell();
var oscr = document.createElement('script');
oscr.name = 'PROJ_DELIVERY';
oCellScr.appendChild(oscr);

The HTML tag holds this:

<td><script>DateInput('PROJ_DELIVERY', true, 'DD-MON-YYYY')</script></td>

The table is set up as a grid and dynamic input rows are added with the addrow() function. Not sure how to code document.createElement for a SCRIPT tag.

Thanks!

DrDoc

5:09 am on Oct 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

Technically, you don't need to (and can't and shouldn't) add the script element itself on the fly. Instead, simply assign the output of a

DateInput('PROJ_DELIVERY', true, 'DD-MON-YYYY')
function call to the table cell's
innerHTML
.

[edited by: DrDoc at 5:09 am (utc) on Oct. 8, 2006]

chiponium

12:59 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



Okay,
Currently the dynamic row creation is set up like this:

oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' maxLength=10 value='' name='PROJ_DELIVERY'>";

What would be the syntax to include DateInput('ORDER_DATE', true, 'DD-MON-YYYY') without my dynamic row function ( addrow() ) not being overridden?

Thanks!