Pārlūkot izejas kodu

changed how radiobuttons work in forms

master
Dom SP pirms 3 gadiem
vecāks
revīzija
7455f835e0
1 mainītis faili ar 6 papildinājumiem un 6 dzēšanām
  1. +6
    -6
      app/views/form.htm

+ 6
- 6
app/views/form.htm Parādīt failu

@@ -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>

Notiek ielāde…
Atcelt
Saglabāt