I have a site which is using sessions to pass data from one page through
to the next. The problem that I have is that there are only two places
where the session could/should be destroyed. This is where a form is
printed using :
<input type="button" name="Button" value="Print Order"
onClick="window .print();">
or when the order form is reset using a JavaScript function :
<SCRIPT LANGUAGE="JavaS cript">
function btnResetFormCli ck(orderform)
{
orderform.reset ();
var i;
for(i=0;i<docum ent.orderform.e lements.length; i++)
{
if(document.ord erform.elements[i].type=="checkbo x" &&
document.orderf orm.elements[i].checked==true)
{
document.orderf orm.elements[i].checked=false;
}
}
//Just thought - will code an automatic "reload main page" bit here
}
The reset has to be done like this because some of the checkboxes are
built with a default value of checked which is determined by a PHP
session variable passed through from the previous page.
So I want to destroy the session at one of these two points but I can't
see how to do it. On button calls an inline function to print and the
other button calls a JavaScript function.
Any ideas on how to do this? If this a JavaScript issue then please say
so and I'll post in the JS group.
Thanks.
to the next. The problem that I have is that there are only two places
where the session could/should be destroyed. This is where a form is
printed using :
<input type="button" name="Button" value="Print Order"
onClick="window .print();">
or when the order form is reset using a JavaScript function :
<SCRIPT LANGUAGE="JavaS cript">
function btnResetFormCli ck(orderform)
{
orderform.reset ();
var i;
for(i=0;i<docum ent.orderform.e lements.length; i++)
{
if(document.ord erform.elements[i].type=="checkbo x" &&
document.orderf orm.elements[i].checked==true)
{
document.orderf orm.elements[i].checked=false;
}
}
//Just thought - will code an automatic "reload main page" bit here
}
The reset has to be done like this because some of the checkboxes are
built with a default value of checked which is determined by a PHP
session variable passed through from the previous page.
So I want to destroy the session at one of these two points but I can't
see how to do it. On button calls an inline function to print and the
other button calls a JavaScript function.
Any ideas on how to do this? If this a JavaScript issue then please say
so and I'll post in the JS group.
Thanks.
Comment