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
cgi_redirect_uri(3)						     cgi/cgi.h						       cgi_redirect_uri(3)

NAME
cgi_redirect_uri - send an HTTP 302 redirect response SYNOPSIS
#include <cgi/cgi.h> void cgi_redirect_uri (CGI *cgi, const char *fmt, ...) ATTRIBUTE_PRINTF(2,3); ARGUMENTS
cgi - cgi struct fmt - printf style format with args DESCRIPTION
cgi_redirect_uri will redirect the user to another page on your site. This version takes the full URL, including proto- col/domain/port/path. As with all printf style commands, you should not call this with arbitrary input that may contain % characters, if you are forwarding something directly, use a format like cgi_redirect (cgi, "%s", buf) RETURN VALUE
None SEE ALSO
cgi_debug_init(3), cgi_parse(3), cgi_destroy(3), cgi_js_escape(3), cgi_html_escape_strfunc(3), cgi_register_strfuncs(3), cgi_output(3), parse_rfc2388(3), cgi_url_validate(3), open_upload(3), cgi_cs_init(3), cgi_url_escape_more(3), cgi_html_strip_strfunc(3), cgi_neo_error(3), cgi_redirect(3), cgi_filehandle(3), cgi_register_parse_cb(3), cgi_url_escape(3), cgi_init(3), cgi_redirect_uri(3), cgi_cookie_clear(3), cgi_url_unescape(3), cgi_vredirect(3), cgi_display(3), cgi_html_ws_strip(3), cgi_error(3), cgi_cookie_set(3), cgi_text_html_strfunc(3), cgi_cookie_authority ClearSilver 12 July 2007 cgi_redirect_uri(3)
All times are GMT -4. The time now is 01:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy