[CKAN-support] [Open Knowledge Foundation] Assignment: Trouble with adding a custom field but not using form.input()

Adam McGreggor notifications-support at okfn.zendesk.com
Tue Mar 11 11:40:36 UTC 2014


##- Please type your reply above this line -##

[Open Knowledge Foundation] Assignment: Trouble with adding a custom field but not using form.input()

You have been assigned to this ticket (#68).

----------------------------------------------

Carlos Quiros, Mar 11 10:54

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

--------------------------------
This email is a service from Open Knowledge Foundation.









[NP1V-2DJR]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ckan-support/attachments/20140311/4c0f01c7/attachment-0002.html>


More information about the ckan-support mailing list