tag_body_start = ""; $this->AddOption('type','checkbox'); $this->AddOption('value','yes'); $this->SetName($name); $this->SetCaption($caption); $this->SetChecked($value); $this->SetAction($action); } function SetName($value='checkbox') { if(!is_string($value)) { return $this->error("Incorrect value for SetName [$value]"); } return $this->AddOption("name",$value); } function SetCaption($value=NULL) { if(is_null($value)) return 0; elseif(is_string($value)) return $this->AddItem(nbsp($value)); return $this->error("Incorrect value for SetCaption [$value]"); } function SetChecked($value="yes") { if($value=="yes" || $value=="checked" || $value=="on" || $value==1) return $this->AddOption("checked","checked"); elseif($value=="no" || $value=="unchecked" || $value=="off" || $value==NULL || $value==0) return $this->DelOption("checked"); return $this->error("Incorrect value for SetChacked [$value]"); } function SetAction($value='submit()', $event='onClick') { if(is_null($value)) return 1; if(!is_string($value)) return $this->error("Incorrect value for SetAction [$value]"); if(!is_string($event)) return $this->error("Incorrect event for SetAction [$event]"); return $this->AddOption($event,$value); } } ?>