Suggestion: CreateInputReset
Posted: Sat Sep 10, 2005 12:52 pm
While working on my FAQ/Q&A module I nedded a reset-buton, so I tried CreateInputReset(), but this was not available, so I created it.
Here is the code, it should be placed in class.module.inc.php
Here is the code, it should be placed in class.module.inc.php
Code: Select all
/**
* Returns the xhtml equivalent of a reset button. This is basically a nice little wrapper
* to make sure that id's are placed in names and also that it's xhtml compliant.
*
* @param string The id given to the module on execution
* @param string The html name of the button
* @param string The predefined value of the button, if any
* @param string Any additional text that should be added into the tag when rendered
*/
}
function CreateInputReset($id, $name, $value='', $addttext='')
{
$text = '<input type="reset" name="'.$id.$name.'" value="'.$value.'"';
if ($addttext != '')
{
$text .= ' '.$addttext;
}
$text .= ' />';
return $text . "\n";
}