http://www.perlmonks.org?node_id=930115


in reply to Javascript with CGI

Why alert box not appearing in the first code or what steps shall i take to make alert box working in the first code with the value in name textbox.

Because you're not paying attention :)

See CGI button -onClick not working

Examine the generated HTML and you'll see there is no id='name'

$ perl -MCGI -le " print CGI->textfield(q[name]) " <input type="text" name="name" />