View Issue Details

IDProjectCategoryView StatusLast Update
0021947mantisbtuipublic2017-01-27 13:48
Reportermcmo Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.0.0-rc.1 
Summary0021947: Required custom fields whose type is radio or checkbox do not display with a red asterisk.
Description

I have checked the styles using the Chrome developer tools and that confirms that the radio or checkbox fields do not have the class "required".

TagsNo tags attached.
Attached Files

Relationships

related to 0021886 confirmed custom fields whose type is radio or checkbox display in bold 
related to 0022270 confirmed Marked as required marker is missing on custom fields page 

Activities

mcmo

mcmo

2016-11-23 15:39

reporter   ~0054570

this is similar to 0021886

atrol

atrol

2016-11-23 16:23

developer   ~0054571

Requiring checkbox input is not possible.
How do you want to check that the user entered a value?

Requiring radio input should be possible, but offering a radio box without a selected default value is no good practice.

mcmo

mcmo

2016-11-24 09:44

reporter   ~0054576

I found a solution that also fixes 0021886. see attached patch file

patch for 21886 and 21947.txt (838 bytes)   
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/<html>bug_report_page.php (<b>02-Nov-2016 14:19:33</b>)</html>
+++ b/<html><b>Current File</b></html>
@@ -601,11 +601,9 @@
 ?>
 	<tr>
 		<th class="category">
-			<?php if( $t_def['type'] != CUSTOM_FIELD_TYPE_RADIO && $t_def['type'] != CUSTOM_FIELD_TYPE_CHECKBOX ) { ?>
 				<label for="custom_field_<?php echo string_attribute( $t_def['id'] ) ?>"<?php if( $t_def['require_report'] ) {?> class="required"<?php } ?>>
 					<?php echo string_display( lang_get_defaulted( $t_def['name'] ) ) ?>
 				</label>
-			<?php } else { echo string_display( lang_get_defaulted( $t_def['name'] ) ); } ?>
 		</th>
 		<td>
 			<?php print_custom_field_input( $t_def, ( $f_master_bug_id === 0 ) ? null : $f_master_bug_id ) ?>
mcmo

mcmo

2016-11-24 12:15

reporter   ~0054578

when there are several options for a checkbox input, it is possible to make it mandatory; I agree that with one option only, requiring it makes no sense.
The checkbox input is in terms of possible choices equivalent to a list input (cf. https://www.mantisbt.org/docs/master-1.3.x/en-US/Admin_Guide/html-desktop/#admin.customize.customfields.definitions)
If it is possible to require a list input, then it should also be the case for the checkbox, if there are several options.
I agree that requiring a radio input without a selected default value is not fine.