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

@@ -7,10 +7,10 @@
name="{{ @name }}"
id="{{ @name }}"
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 }}"
{{ @info.required ? 'required' : '' }} />
{{ (array_key_exists('required',@info) && @info.required ) ? 'required' : '' }} />
<!--<label for="{{ @name }}">{{ @info.description }}</label>--><br>
</true>
</check>
@@ -46,7 +46,7 @@
id="{{ sprintf('%s[%s]',@name,@key) }}"
name="{{ sprintf('%s[%s]',@name,@key) }}"
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) }}">
{{ @val }}</label><br>
</repeat>
@@ -61,9 +61,9 @@
type="radio"
id="{{ sprintf('%s-%s',@name,@key) }}"
name="{{ sprintf('%s',@name) }}"
value="{{ @val }}"
value="{{ @key }}"
{{ @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) }}">
{{ @val }}</label>
</repeat>

Loading…
Cancel
Save