Sponsored Content
Top Forums Shell Programming and Scripting [SOLVED] Submit Button is not Recognizable Post 302740371 by gkrish on Thursday 6th of December 2012 08:01:43 AM
Old 12-06-2012
[SOLVED] Submit Button is not Recognizable

Hi ...

I am writing a PERL CGI script where firstly i display a Submit button and when i click that, it will display a group of checkbox values and another submit button.

My question is Now, if i click the second submit button, it should get the checkbox values and work with those(do some calculations) ...

But its not happening ... when i click second submit button nothing happens ... it just stays calm ....

Here is the Sample Code ...

Code:
#!/usr/local/bin/perl5

print "Content-type: text/html; charset=iso-8859-1\n\n";

use strict;
use warnings;
use CGI;

my $cgi = CGI->new;

print $cgi->start_html('-title' => 'Example', -author => 'Krishna Chaitanya G', -bgcolor => 'grey');

print $cgi->start_form(), "\n";

print $cgi->submit( '-name' => 'button1', '-value' => 'Search' );

print $cgi->end_form();

if ( $cgi->param('button1') )
{
        print $cgi->checkbox_group(-name=>'open_mods',-values=>[1,2,3,4,5],-multiple=>'true',-columns=>8,-rows=>12);
        print $cgi->submit( '-name' => 'button2', '-value' => 'Close' );
}

if ( $cgi->param('button2') )
{
	print $cgi->param('open_mods');
}

print $cgi->end_html();

As per my above idea ... if i click second submit button the output in browser should print the selected checkbox values ... But, now its nothing

Please Help ....

---------- Post updated at 06:31 PM ---------- Previous update was at 04:09 PM ----------

got it working ...

Had to change the end_form() placement ...

Last edited by gkrish; 12-06-2012 at 07:01 AM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script for using the Back button and the Close button

Here's a question I have for anyone that might be able to help me: I can write a html script that will allow the user to return to the previous page using the back button, and I can write a script that will allow the user to return to the previous page using the close button, but...is there a... (1 Reply)
Discussion started by: mdgibson
1 Replies

2. Forum Support Area for Unregistered Users & Account Problems

cant submit anything

hello admins, i dont use unix.com very often - but when i do have questions, i submit them at the site - but now I cannot submit anything in any forum on the site. The is the only forum i could add a new thread. its tells me that my account could be de-righted, or that im tring to submit... (1 Reply)
Discussion started by: congo
1 Replies

3. UNIX for Dummies Questions & Answers

Changing middle mouse button for pasting to right mouse button in cygwin rxvt

Hi, I'm using rxvt in Cygwin and I'm wondering how to change my mouse bindings from the middle button for pasting to the right button. The main reason why I want to do this is because my laptop doesn't have a middle mouse button. Thanks for any help! (2 Replies)
Discussion started by: sayeo
2 Replies

4. Shell Programming and Scripting

include virtual perl-script - submit button opens a new page..

hello 2 all I can't understand how to insert a perl-script into .shml in a right way. <form> should be working but it's not doing that: <!--#include virtual="/cgi-bin/script.cgi?filename"--> filename is a name of the file which script is using the script is used for a score show (the number... (0 Replies)
Discussion started by: tip78
0 Replies

5. Web Development

include virtual perl-script - submit button opens a new page..

hello 2 all I can't understand how to insert a perl-script into .shml in a right way. <form> should be working but it's not doing that: <!--#include virtual="/cgi-bin/script.cgi?filename"--> filename is a name of the file which script is using the script is used for a score show (the number... (3 Replies)
Discussion started by: tip78
3 Replies

6. Shell Programming and Scripting

Validation of Text field while Click on submit button

I am using Perl CGI. I have created some text fields and getting those values. But i want if user leave the text field blank when he click on submit button then instead of run a script it should give a popup. Please any body suggest me something..??? (0 Replies)
Discussion started by: Navrattan Bansa
0 Replies

7. Shell Programming and Scripting

Curl to hit the submit button

Hello, I am looking to hit a URL using curl and click on submit button so that I can get the results. The below is the code <input name="tos_accepted" id="tos_accepted" class="button" type="submit" value="Yes, I Agree"/> <input name="tos_discarded" id="tos_discarded"... (1 Reply)
Discussion started by: Kochappa
1 Replies

8. Web Development

Apache2 web application- Submit button - write data into a file

Hello, I am newbie on php-mysql and just know only installation. I have an apache2+php5+mysql installed VPS. What I would like to do is that when visitor enters requested data shown in index.html, submit button will run a script to save each field into a file. Here is an example shown in... (1 Reply)
Discussion started by: baris35
1 Replies
Template::Plugin::URL(3)				User Contributed Perl Documentation				  Template::Plugin::URL(3)

NAME
Template::Plugin::URL - Plugin to construct complex URLs SYNOPSIS
[% USE url('/cgi-bin/foo.pl') %] [% url(debug = 1, id = 123) %] # ==> /cgi/bin/foo.pl?debug=1&amp;id=123 [% USE mycgi = url('/cgi-bin/bar.pl', mode='browse', debug=1) %] [% mycgi %] # ==> /cgi/bin/bar.pl?mode=browse&amp;debug=1 [% mycgi(mode='submit') %] # ==> /cgi/bin/bar.pl?mode=submit&amp;debug=1 [% mycgi(debug='d2 p0', id='D4-2k[4]') %] # ==> /cgi-bin/bar.pl?mode=browse&amp;debug=d2%20p0&amp;id=D4-2k%5B4%5D DESCRIPTION
The "URL" plugin can be used to construct complex URLs from a base stem and a hash array of additional query parameters. The constructor should be passed a base URL and optionally, a hash array reference of default parameters and values. Used from with a template, it would look something like the following: [% USE url('http://www.somewhere.com/cgi-bin/foo.pl') %] [% USE url('/cgi-bin/bar.pl', mode='browse') %] [% USE url('/cgi-bin/baz.pl', mode='browse', debug=1) %] When the plugin is then called without any arguments, the default base and parameters are returned as a formatted query string. [% url %] For the above three examples, these will produce the following outputs: http://www.somewhere.com/cgi-bin/foo.pl /cgi-bin/bar.pl?mode=browse /cgi-bin/baz.pl?mode=browse&amp;debug=1 Note that additional parameters are separated by '"&amp;"' rather than simply '"&"'. This is the correct behaviour for HTML pages but is, unfortunately, incorrect when creating URLs that do not need to be encoded safely for HTML. This is likely to be corrected in a future version of the plugin (most probably with TT3). In the mean time, you can set $Template::Plugin::URL::JOINT to "&" to get the correct behaviour. Additional parameters may be also be specified to the URL: [% url(mode='submit', id='wiz') %] Which, for the same three examples, produces: http://www.somewhere.com/cgi-bin/foo.pl?mode=submit&amp;id=wiz /cgi-bin/bar.pl?mode=browse&amp;id=wiz /cgi-bin/baz.pl?mode=browse&amp;debug=1&amp;id=wiz A new base URL may also be specified as the first option: [% url('/cgi-bin/waz.pl', test=1) %] producing /cgi-bin/waz.pl?test=1 /cgi-bin/waz.pl?mode=browse&amp;test=1 /cgi-bin/waz.pl?mode=browse&amp;debug=1&amp;test=1 The ordering of the parameters is non-deterministic due to fact that Perl's hashes themselves are unordered. This isn't a problem as the ordering of CGI parameters is insignificant (to the best of my knowledge). All values will be properly escaped thanks to some code borrowed from Lincoln Stein's "CGI" module. e.g. [% USE url('/cgi-bin/woz.pl') %] [% url(name="Elrich von Benjy d'Weiro") %] Here the spaces and ""'"" character are escaped in the output: /cgi-bin/woz.pl?name=Elrich%20von%20Benjy%20d%27Weiro An alternate name may be provided for the plugin at construction time as per regular Template Toolkit syntax. [% USE mycgi = url('cgi-bin/min.pl') %] [% mycgi(debug=1) %] AUTHOR
Andy Wardley <abw@wardley.org> <http://wardley.org/> COPYRIGHT
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Template::Plugin perl v5.16.3 2011-12-20 Template::Plugin::URL(3)
All times are GMT -4. The time now is 09:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy