Hi all

Just want to know if it's possible to check if a checkbox is checked on page load.

Venom Rush

Recommended Answers

All 2 Replies

The onload event is one which can be used in JavaScript, I am not sure exactly what you are asking although if you want to do something after the page loads, ie client side, you will need a client side language(such as JavaScript) otherwise this may be possible in PHP, can you provide more details on exactly what you want to achieve.

Assuming that the need mentioned above is not in the first page
also i'm almost shure that this is not a good way to do this.

try passing value through URL
like

header("location:fileName.php?status=1");
or
header("location:fileName.php?status=1");

then you can use

if(isset($_GET['status'])) {
   if( $_GET['status']==1 )
     //checkbox is checked.
   esle
     //checkbox is unchecked.
}

if you are using(modifying) header don't forget to add
ob_start();
in the first line of your program.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.