can anybody tell me what's wrong with the following code?
the form's default value is not displaying although it works well when used as this: '#defaultvalue' => t('asdf')
<?php
function classes_form(){
$arg = arg(3);
if($arg == 'add'){
$form['classname'] = array(
'#type' => 'textfield',
'#required' => true,
'#title' => t('Text Number One'),
'#size' => 30,
'#maxlength' => 50,
'#weight' => -1,
);
$form['weight'] = array(
'#type' => 'textfield',
'#required' => true,
'#title' => t('Text Number Two'),
'#size' => 2,
'#maxlength' => 2,
'#weight' => -2,
);
}elseif($arg == 'edit'){
$classID = arg(4);
$result = db_query("SELECT className, weight FROM grades_classes WHERE classID = %s LIMIT 0,1", $classID);
$row_result = db_fetch_object($result);
$form['classname'] = array(
'#type' => 'textfield',
'#required' => true,
'#title' => t('Text Number One'),
'#size' => 30,
'#maxlength' => 50,
'#weight' => -1,
'#defaultvalue' => $row_result->className
);
$form['weight'] = array(
'#type' => 'textfield',
'#required' => true,
'#title' => t('Text Number Two'),
'#size' => 2,
'#maxlength' => 2,
'#weight' => -2,
'#defaultvalue' => $row_result->weight
);
}
return system_settings_form('classes_form', $form);