Location: PHPKode > scripts > Generate form controls > generate-form-controls/class.inputcontrols.php
<?
Class InputControls
{
//------- Draw textbox -------------------
function textctr($name,$value)
{
$form=<<<here
	<input type="text" name="$name" value="$value">
here;
return $form;
}

//------- Draw passwordctr -------------------
function passwordctr($name,$value)
{
$form=<<<here
	<input type="password" name="$name" value="$value">
here;
return $form;
}

//--------------- Draw textarea ----------
function textareactr($name)
{
$form=<<<here
	<textarea name="$name"></textarea>
here;
return $form;
}

//--------------- Draw checkbox ----------
function checkboxctr($name,$value)
{
$form=<<<here
	<input type="checkbox" name="$name" value="$value">
here;
return $form;
}

//--------------- Draw radiobutton ----------
function radioctr($name,$value)
{
$form=<<<here
	<input type="radio" name="$name" value="$value">
here;
return $form;
}

//--------------- Draw Button ----------
function buttonctr($type,$name,$value)
{
$form=<<<here
	<input type="$type" name="$name" value="$value">
here;
return $form;
}

//--------------- Draw listbox ----------
function drawoption($name)
{
$form.=<<<here
	<option value="">$name
here;
return $form;
}

//--------------- Draw listbox ----------
function listctr($noitem)
{
$form=<<<here
	<select name="">
here;
for($i=0; $i<$noitem; $i++)
{
	$form.=$this->drawoption("test");
}
$form.=<<<here
	</select>
here;
return $form;
}
}

/* $IC = new InputControls;
echo $IC->textctr("abc","");
echo $IC->textareactr("abc","");
echo $IC->checkboxctr("abcd","");
echo $IC->radioctr("abc","");
echo $IC->radioctr("abc","");
echo $IC->listctr(4);
echo $IC->passwordctr("abc","");
*/
?>
Return current item: Generate form controls