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
Button(3I)						    InterViews Reference Manual 						Button(3I)

NAME
ButtonState, Button, TextButton, PushButton, RadioButton, CheckBox - interactive buttons SYNOPSIS
#include <InterViews/button.h> DESCRIPTION
Button is a class of interactors that can set the value of a piece of state. ButtonState is a class of objects that contain a value and a list of buttons that can set its value. A value is either an integer or an arbitrary pointer. TextButton is a subclass of Button that has an associated text label to be displayed inside or to the right of the button. PushButton, RadioButton, and CheckBox are subclasses of TextButton that provide particular displays for buttons. Each kind of button will display itself differently for each of the five possible cases: ``enabled'', when the button is listening to input, ``disabled'', when the button is not listening, ``chosen'', when the button's value is equal to its button state's value, ``hit'', when a button that is not chosen first receives a DownEvent, and ``same-hit'', when a button that is chosen receives a DownEvent. When a button receives a DownEvent, it calls the virtual Refresh() to update its display. It then reads input waiting for an UpEvent. If the UpEvent coordinates are also within the button, then it calls the virtual Press(). The default Press operation sets the associated state's value to the button's value. A button can have a list of attached buttons. When a button is not chosen its attached buttons are ``disabled'', meaning they ignore all input events. BUTTONSTATE OPERATIONS
ButtonState() ButtonState(int) ButtonState(void*) Define a button state optionally with an initial value. void Attach(Button*) Add a button to the list associated with a button state. The button will be notified when the button state's value is modified. void Detach(Button*) Remove a button from the list associated with a button state. void GetValue(int&) void GetValue(void*&) Get the value of a button. void SetValue(int) void SetValue(void*) Set the value of a button state and notify all the buttons associated with the state. void operator=(ButtonState&) Copy the value of one button state to another. The button list associated with the source button state is not copied. BUTTON OPERATIONS
void PushButton(const char* text, ButtonState* s, int v) void PushButton(const char* text, ButtonState* s, void* v) Construct a button with text in the center and a polygon on the outside. The polygon is like a rectangle, but with rounded corners. When chosen, the entire button is drawn with foreground and background colors reversed. void RadioButton(const char* text, ButtonState* s, int v) void RadioButton(const char* text, ButtonState* s, void* v) Construct a button with a circle on the left and text on the right. When hit, a second circle is drawn inside the first. When cho- sen, a filled circle is drawn inside the outer circle. void CheckBox(const char* text, ButtonState* s, int on, int off) void CheckBox(const char* text, ButtonState* s, void* on, void* off) Construct a button with a rectangle on the left and text on the right. When hit, a second rectangle is drawn inside the first. When chosen, two diagonal lines are drawn connecting the opposite corners of the rectangle. When a checkbox is pressed the first time, it sets s to off if the value is on and sets s to on otherwise. Subsequent presses swap the values of the checkbox and s. void Attach(Button*) Add to this button's list of associated buttons. These buttons are enabled when the button is chosen and disabled when it is not chosen. void Detach(Button*) Remove a button from this button's list of associated buttons. void Disable() Stop listening to input events. Disabled buttons are typically ``grayed out'' by drawing a half-filled rectangle in the background. void Enable() Start listening to input events. void Choose() Make the button as chosen, enabling any associated buttons. void Handle(Event&) If the event type is DownEvent and the button is enabled, call Refresh and read events until an UpEvent occurs. If the button is the target of the UpEvent, then call Press. virtual void Press() Take the appropriate action for the button being pressed. The default is to set the associated state to the button's value, which will trigger all related buttons to update their display. virtual void Refresh() Update the button display. void SetDimensions(int width, int height) Specify the natural size of the button. The default size is a function of the size of the text. This routine is obsolete; use Interactor::Reshape instead. void UnChoose() Mark the button as not chosen, disabling any associated buttons. SEE ALSO
Event(3I), Interactor(3I) InterViews 15 June 1987 Button(3I)
All times are GMT -4. The time now is 04:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy