Browse Source

changed how radiobuttons work in forms

master
Dom SP 3 years ago
parent
commit
7455f835e0
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      app/views/form.htm

+ 6
- 6
app/views/form.htm View File

name="{{ @name }}" name="{{ @name }}"
id="{{ @name }}" id="{{ @name }}"
type="{{ @info.type }}" type="{{ @info.type }}"
size="{{ @info.length }}"
value="{{ @info.value }}"
size="{{ array_key_exists('length',@info) ? @info.length : 20 }}"
value="{{ array_key_exists('value',@info) ? @info.value : '' }}"
placeholder="{{ @info.description }}" placeholder="{{ @info.description }}"
{{ @info.required ? 'required' : '' }} />
{{ (array_key_exists('required',@info) && @info.required ) ? 'required' : '' }} />
<!--<label for="{{ @name }}">{{ @info.description }}</label>--><br> <!--<label for="{{ @name }}">{{ @info.description }}</label>--><br>
</true> </true>
</check> </check>
id="{{ sprintf('%s[%s]',@name,@key) }}" id="{{ sprintf('%s[%s]',@name,@key) }}"
name="{{ sprintf('%s[%s]',@name,@key) }}" name="{{ sprintf('%s[%s]',@name,@key) }}"
value="true" value="true"
{{ is_array(@info.checked) ? in_array(@key,@info.checked) ? 'checked' : '' : !strcmp(@key,@info.checked) ? 'checked' : '' }} />
{{ is_array(@info.checked) ? (in_array(@key,@info.checked) ? 'checked' : '') : (!strcmp(@key,@info.checked) ? 'checked' : '') }} />
<label for="{{ sprintf('%s[%s]',@name,@key) }}"> <label for="{{ sprintf('%s[%s]',@name,@key) }}">
{{ @val }}</label><br> {{ @val }}</label><br>
</repeat> </repeat>
type="radio" type="radio"
id="{{ sprintf('%s-%s',@name,@key) }}" id="{{ sprintf('%s-%s',@name,@key) }}"
name="{{ sprintf('%s',@name) }}" name="{{ sprintf('%s',@name) }}"
value="{{ @val }}"
value="{{ @key }}"
{{ @info.required ? 'required' : '' }} {{ @info.required ? 'required' : '' }}
{{ is_array(@info.checked) ? in_array(@key,@info.checked) ? 'checked' : '' : !strcmp(@key,@info.checked) ? 'checked' : '' }} />
{{ is_array(@info.checked) ? (in_array(@key,@info.checked) ? 'checked' : '') : (!strcmp(@key,@info.checked) ? 'checked' : '') }} />
<label for="{{ sprintf('%s-%s',@name,@key) }}"> <label for="{{ sprintf('%s-%s',@name,@key) }}">
{{ @val }}</label> {{ @val }}</label>
</repeat> </repeat>

Loading…
Cancel
Save