selecting all checkboxes

Posted on 2006-03-27
Last Modified: 2013-12-25
I have a form where the user enters all the data and clicks submit. The parameters enetered are then passed to web page 2 where the data is displayed. The fields are text boxes except for 1 question which uses checkboxes. There are 1 to 10 checkboxes and also a checkbox for all.

How do i select all so that all checkboxes (1 to 10) are selected.

here's the code from the first page

the code on the 2nd page to display the data is
$checkid= param("checkid");
print "ID = $checkid<br>";

how can i select all checkbox and all the checkboxes (numbered 1 to 10) are selected.
what do i need to do so that the checkboxes checked on page 1 are displayed on page 2.

Question by:plennon
    LVL 48

    Accepted Solution

    This is a HTML question rather than Perl.

    If you want all checkboxes checked, then do:

    print <<EOF;
    <input type="checkbox" name="IDr1" value="1" checked>1
    <input type="checkbox" name="IDr2" value="2" checked>2

    LVL 51

    Assisted Solution

    > how can i select all checkbox and all the checkboxes
    do you mean "select in the browser" when seeing the page?
      then you have to use something like JavaScript

    or do you mean write the checkboxes checked back from your CGI?
      see Tintin's suggestion


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
    This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
    Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now