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="JavaScript">
function btnResetFormClick(orderform)
{
orderform.reset();
var i;
for(i=0;i<document.orderform.elements.length;i++)
{
if(document.orderform.elements[i].type=="checkbox" &&
document.orderform.elements[i].checked==true)
{
document.orderform.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.