Operating System - Linux
1827808 Members
12436 Online
109969 Solutions
New Discussion

Re: Help required on Perl GUI

 
SOLVED
Go to solution
Pankaj Yadav_1
Frequent Advisor

Help required on Perl GUI

I want to generate a POP UP using Perl.

When I click on a link a pop up should be displayed with a FORM having a submit button.

I should be able to provide data to his pop up as well as submit data from it .

4 REPLIES 4
Ralph Grothe
Honored Contributor
Solution

Re: Help required on Perl GUI

Usually these kind of pop-ups are implemented as some JavaScript code embedded in the HTML sent by the webserver, and are executed at an onClick event on behalf of the client's agent/browser (client side execution).
I think to remember that there once was a project dedicated to client side Perl execution.
But this would require all your clients to have Perl (presumably with a special module) installed which is quite unlikely.
Besides, nowadays everyone seems to go mad about so called Web 2.0 technologies like Ajax etc.
However, nothing prevents you from discarding any client side action (very client friendly as it doesn't reuire them to have any additional interpreters or plug-ins installed ) and instead completely rely on server side scripting in Perl.
The simplest technique would be to have the href attribute point to a cgi Perl script on your server that generates the form.
However, I have no idea how this can be cast into a pop-up window since this to my notion is usually generated by the browser's rendering machine and thus some form of client side execution?
Maybe if you search a little in CPAN you also might come accross some client side Perl module, or similar?
Madness, thy name is system administration
Pankaj Yadav_1
Frequent Advisor

Re: Help required on Perl GUI

Actually I have a Perl cgi file and a HTML template file.
I give values to the template file from Perl cgi.

Can u give me the code of POP UP using Javascipt which I will put in the HTML template file and generate it ?

I want to give some values to a SELECT statement inside the POP UP(for combo box) and a Submit button to submit the selected value ?
Peter Godron
Honored Contributor

Re: Help required on Perl GUI

Ralph Grothe
Honored Contributor

Re: Help required on Perl GUI

I am no web developer.
All I did was Perl server side scripting.
Only with my first attempts did I do a little JavaScript scripting to get an idea of it.
Because the only websites where I occassionally do some CGI scripting are for internal administrative purposes there is no need for fancy pop-ups or page adornment.
But there are lots of sites on the WWW dedicated to server and client side scripting.
I for once would load an url where I know to be nagged with those pop-ups (don't forget to allow them in your browser settings ;-)
and simply would look at the received html source, especially at the html comment blocks that define appropiate JavaScript functions.
Maybe a basic notion of the document object model that also the various JavaScript methods and attributes refer to would help?
Basically I would think it boils down to one or two lines in those JavaScript functions that simply open a new window (maybe with optional positioning) with the url of your input form.
Finally, a big caveat (why I am not that fond of client side scripting).
You say that you want to feed the input to a database select statement.
Never trust any client input, attributes or variables!!!
Don't trust the data that passed a client side JavaScript input checker!
Always test client input against a set of allowed characters before you use it as input for some database query!
Madness, thy name is system administration