checkbox and reload a page [message #170851] |
Fri, 03 December 2010 11:36 |
anver
Messages: 5 Registered: November 2010
Karma:
|
Junior Member |
|
|
a page with a checkbox and code:
in short
function A () {
checkbox (default off)
check off if {.. code ..)
}
problem:
when the page is loaded, is applied the ..code..;
I would like to click on the check and not apply the ..code..;
so is necessary to reload the page and maintain the value of the check
selected (notice this is a form similar at a form for to create own
account, so the state of checkbox cannot achivied in way permanent in the
db or in a php's variable, but used on the fly)
same code but using a variable
var_A = true;
function A () {
checkbox
if var_A {.. code ..)
}
------
more info
is similar to a normal registration user form with this difference:
generally in these forms, user active checkbox and after with send's button
the php passing its datas to another page;
in my case instead, the whole page is already pre-loaded and the same datas
aree send at a report's page for print;
so checkbox is used for reloading the same page but removing something
variables (with ..code.. that is an unset command)
(this isn't correct but is an attempt to change resuolts without having to
change the original code)
so the variable var_A, should be seen and used only locally,
because each user will opt for their choice
I think that php variable var_A should be relative only at that user while
use the form (cookies, sessions or others)
or integrated with a variable Javascript
how is possible to resolve?
|
|
|