in reply to Re: Add text box while click one button
in thread Add text box while click one button

Hi,

I tried this through javascript in cgi page. But the code shows undefined in cgi page. The same works well in html page.

The Java code is:

function generateRow() {

var d=document.getElementById("text");
d.innerHTML+="

<input type='text' name='food'>";
}

In the above the "getElementById" shows undefined.

Any knows about this or any other method in CGI page.

Regards, Balaji S

  • Comment on Re^2: Add text box while click one button

Replies are listed 'Best First'.
Re^3: Add text box while click one button
by drench (Beadle) on Mar 20, 2009 at 16:17 UTC
    This has nothing to do with Perl anymore. If document.getElementById('text') returns null, then there is no element with the id of 'text' in your HTML. If you're not already doing so, run Firefox and install the Firebug extension and spend some time getting to know it. I wouldn't think of doing any kind of Javascript or DOM debugging without it.