AddPage Row_Rendered according to URL data

On the AddPage I am trying to change some field property according to the URL data

On the Server Event->Add/Copy page->Page_Load
GLOBAL $type;
if(isset($_GET[“type”])){
$type = $_GET[“type”];
}

and on the Server Event->Common->Row_Rendered
GLOBAL $type;
if($type == “old” && CurrentPageID()==“add” && $this->CurrentAction == “show”){
$this->outlet->Visible = FALSE;
$this->name->Visible = FALSE;
$this->pincode->Visible = FALSE;
}

When the GET date $type = “old” I want to hide the 3 field outlet, name pincode.
It works when there is no error in the Server Validation
but if their is Server Validation error then the $type value goes NULL

Because when the error occured, the “type” param in the URL will not be included. Therefore, you need to save the value from “type” param to a session variable instead.