I Have an HTML form that looks like this
<form action='<?php echo($_SERVER["PHP_SELF"]) ?>' method='post' name='demoform'>
file:<input type=file name=link1 id=lnk1>
Date:<input type=text name=me id=ee onFocus="opnexl(this.id,lnk1);">
file2::<input type=file name=link2 id=lnk2>
Date:<input type=text name=me id=aa onFocus="opnexl(this.id,lnk2);">
'
'
'
'
I have a JavaScript function that needs to do something like this
function opnexl(nam,lnks)
{
var str=document.demoform.lnks.value;
if (str == "")
{
document.getElementById(nam).value= "0000-00-00 00:00:00";
}
else
{
var oExcel = new ActiveXObject("Excel.Application");
var oWB = oExcel.workbooks.open(str);
'
'
'
The above code gives this error “document.demoform.lnks.value is null or not an object”. I guess the problem is the Id of the link fields are not being passed to the opnexl function. Does anyone know how I can get this program to work?
Thanks for any help you can give.