[SOLVED] Submit Button is not Recognizable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [SOLVED] Submit Button is not Recognizable
# 1  
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..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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
Login or Register to Ask a Question