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" />

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.