Hello,
I need to add some javascript code block dynamically to a web page.
I looked into the various postings at various groups but none seems to
be solving my problem.
Among the approaches suggested first one is to create a script element
and set its properties (src etc) and then adding this script element to
the head element.
This works good for a dynamically including the files. But, in my case
I do not have any files but generating the content dynamically which
should be available to other javascript functions in the page. The
script that I need to add dynmically is given below :
------------------------------------------------------------
var numberOfReowsDisplayed =
eval(formFieldsArray[getNetuiTagName("numberOfRecordsDisplayed",this)]).value
if(netui_names && numberOfReowsDisplayed && numberOfReowsDisplayed > 0
){
s = ''
for(i=0; i<numberOfReowsDisplayed; i++){
s = s +
"netui_names.startDate["+i+"]={actionForm.serviceProductAssociation[" +
i + "].startDate}" + "\n"
}
}
------------------------------------------------------------
Content of the variable 's' needs to be added dynamically.
I cant do this at the server side as the formFieldsArray is generateed
by the netUi framework, control of which I dont have, hence I cant
decide if I should output when I am on the server side.
I am crossing deadline and tired of various trial and errors.
Any help is greatly appreciated.
Thanks a ton,
cg