RM 1.2 Upload file option check box (resource add)

reddy ink

Active member
I would like to have Default check radio for "Does not have file" instead of Uploaded file (as shown below).
I have tried to change as below which didn't work. Appreciate any suggestions.
Resource_add template change
From
Code:
<li><label><input type="radio" name="resource_file_type" value="fileless" {xen:checked '{$resourceType} == "fileless"'} /> {xen:phrase does_not_have_file}</label>
to
Code:
<li><label><input type="radio" name="resource_file_type" value="fileless" checked="checked" /> {xen:phrase does_not_have_file}</label>

upload_2015-12-21_21-49-15.webp
 
This template is used for editing as well, so you need to be very careful how you handle this.

The issue is likely that there's another box still selected in the HTML; you can't select two so what the browser does is up to it.

You need to do something like:
Code:
{xen:if $resource.resource_id, {xen:checked '{$resourceType} == "fileless"'}, ' checked="checked"'}
For each option. (Note not that exact code; it needs to be modified for each option and only the fileless option should fallback to checked=checked.)
 
Back
Top Bottom