Index: trunk/kernel/parser.php
===================================================================
diff -u -r1278 -r1279
--- trunk/kernel/parser.php (.../parser.php) (revision 1278)
+++ trunk/kernel/parser.php (.../parser.php) (revision 1279)
@@ -439,6 +439,7 @@
@attrib: _Field:: Field Name
@attrib: _Value:: Value assigned to radio button. If the form field value matches this attribute, the radio button is CHECKED
@attrib: _Required:bool: If set, In-Portal requires this field have a value when submitting
+ @attrib: _Default:string: Default value for radiobutton if not checked
@attrib: _Custom:bool: If set, handled as a custom field
@example:
*/
@@ -447,21 +448,22 @@
global $FormValues, $objConfig;
$html_attribs = ExtraAttributes($attribs);
- $form = $attribs["_form"];
- $field = strtolower($attribs["_field"]);
- $val = $attribs["_value"];
- if(isset($_POST[$field]))
+ $form = $attribs['_form'];
+ $field = strtolower($attribs['_field']);
+ $val = $attribs['_value'];
+
+ if( GetVar($field) !== false )
{
- $value = (int)$_POST[$field];
- if($value==1)
- $checked = " CHECKED";
+ $value = GetVar($field);
+ if($value == $val) $checked = ' CHECKED';
}
else
- {
- $value = (int)$FormValues[$form][$field];
- if($value==$val)
- $checked=" CHECKED";
+ {
+ $value = $FormValues[$form][$field];
+ if( getArrayValue($attribs,'_default') ) $value = $val;
+ if($value==$val) $checked=' CHECKED';
}
+
//echo $form.".".$field."=".$value."
\n";
$ret = "";
if($attribs["_required"])