Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Javascript with CGI

by Anonymous Monk
on Oct 07, 2011 at 06:30 UTC ( #930115=note: print w/ replies, xml ) Need Help??

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

Comment on Re: Javascript with CGI
Download Code
Replies are listed 'Best First'.
Re^2: Javascript with CGI
by tarunkhanna (Novice) on Oct 07, 2011 at 06:37 UTC
    yeah, I can see that...

    But it's not even working with

      Well your problkem is that you need to add the 'id' attribute. According to the docs, you can add it with a named parameter using '-id' but you'll have to change the way you pass the name parameter. This works:
      $textfield = CGI->textfield({ -name => 'name', -id => 'name' });
      as does this:
      $textfield = CGI->textfield(-name => 'name', -id => 'name');

      And? If you wish to debug your HTML and javascript, go to a different forum

        Yeah, I have to do that if I don't get solution here.

        The point is this forum is also to help each other. That's why I posted here. If you know the solution, you can tell me.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930115]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2015-12-01 20:21 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (26 votes), past polls