Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking value of variable

Status
Not open for further replies.

lucknowm

MIS
Jun 4, 1999
19
0
0
US
I am inputting a variable from a checkbox as follows :

input_type = checkbox
name = ora_err
value = unchecked

I want to implement following logic :

if ( $ORA_ERR is checked )
{
do something
}

help.

 
here is a simple CGI snippet that should help get you on your way:

#!/usr/bin/perl

use CGI;

$q = new CGI;
# Build some standard web page elements
print $q->header;
print $q->start_html('check box example');
print $q->h1('Check Box Example');

# Build our checkbox. The first parameter is the name, which can be anything you like.
# The second is the checkbox's default state. The third is the value of the checkbox when
# it is clicked (I use 1 because integers are easy to compare, but you really can use
# whatever you like). The forth parameter is the label associated with the check box.

print $q->checkbox('checkbox1','checked','1','CLICK ME');

# End the HTML page
print $q->end_html;

------------End of Code Snippett---------

The CGI perl module is installed by default. You can get good info about this module from:


**** NOTE: This is not a complete perl app. It will run from a web browser and you should see a check box.

I hope this helps!

Bryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top