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
XDEMINEUR(6x)															     XDEMINEUR(6x)

NAME
xdemineur - X11 minesweeper game SYNOPSIS
xdemineur [-v] [-display displayname] [-geometry geom] [-m mines] DESCRIPTION
Xdemineur is a minesweeper game for the X Window System. The object of this game is to find the location of the mines hidden in the minefield and to mark their location by placing a warning flag. You have exactly as many flags as there are mines. The number of flags that remain to be placed is displayed in the top left corner of the window and a timer is displayed in the top right corner. The game is played using a three buttons mouse, as usual with the X Window System. The left button (button 1) is used to uncover the square on which you click (hoping that a mine is not hidden there). The number displayed in an uncovered square indicates how many mines are located around this square (for example, a 3 means that there are three mines within the 8 surrounding squares). The whole game relies on the right use of these numbers. The right button (button 3) is used to place a flag on a square (this indicates that there is a mine here). If you click again with the right button on a square that has a flag, the flag is changed into a question mark: this is useful if you are trying to guess the possible location of some mine, you can use question marks to think about it. One more click with the right button and the question mark disappears. Clicking with the middle button (button 2) on an uncovered square which has all its flags placed around uncovers the surrounding cells which have no flags (this will save a lot of time). Finally, to start a new game, just click on the yellow face above the minefield. OPTIONS
-v Print out version number and copyright notice then exit. -display displayname This option specifies the name of the X server to use. See X(1). -geometry geom This option specifies the initial size and location of the window. See X(1). The size is expressed in number of columns times num- ber of rows. The default is 30x16. The minimum number of columns is 12. -m mines This option specifies the number of mines in the minefield. If there are more mines than squares in the minefield, the default mine number is used. BUGS
Please report any bug you could find in xdemineur to <babafou@babafou.eu.org>. Also, you should tell me the customizations you may have done, such as adding new functions to the game or making modifications to allow the game to run on your system. COPYRIGHT
Copyright (C) 1993-1999 Marc Baudoin <babafou@babafou.eu.org> Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup- porting documentation. The author makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. AUTHOR
Marc Baudoin <babafou@babafou.eu.org> XDEMINEUR(6x)
All times are GMT -4. The time now is 01:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy