in reply to Add text box while click one button

Any code? Perhaps I don't understand the question fully, but if you want your HTML page to pop-up another text box when pushing a button on the HTML page, you should probably do that with some sort of HTML scripting (Javascript, etc...).

If a Perl script is generating the HTML code, I think you'll still need to know the Javascript to write to the HTML to produce the desired result in the user's browser.

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

Replies are listed 'Best First'.
Re^2: Add text box while click one button
by soubalaji (Sexton) on Mar 20, 2009 at 12:37 UTC
    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

      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.