[CKAN-support] Trouble with adding a custom field but not using form.input()

Carlos Quiros cquiros at qlands.com
Tue Mar 11 10:54:04 UTC 2014


Hi,

I am adding a custom input field that is *working* with the following code:

{{ form.input('ILRI_prjspecies', label=_('Species'), 
id='ILRI_prjspecies', placeholder=_('Cattle, Pigs, Poultry'), 
value=data.ILRI_prjspecies, error=errors.ILRI_prjspecies, 
classes=['control-full']) }}

However I need to have the input with a spacial class and 
_/form.input()/_ add the classes to the <div> and no the <input>. So I 
decided to write the input without _/form.input()/_ like this:

<div class="control-group control-small">
     <label class="control-label" for="ILRI_prjspecies">{{ _("Species") 
}}</label>
     <div class="controls">
       <input type="text" id="ILRI_prjspecies" name="ILRI_prjspecies" 
placeholder="Species" class="tm-ILRI_prjspecies tm-input-success" 
value="{{ data.ILRI_prjspecies }}" >
     </div>
</div>

However is does not load or save the value.

Any idea what I am doing wrong?

Thanks,
Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ckan-support/attachments/20140311/09a78f46/attachment-0002.html>


More information about the ckan-support mailing list