Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
we want to add a field for postcode that will auto show s the addresses that the user can choose.
Is there anything in Umbraco Forms that does this?
Thanks!
no, but you can create your own. you need to create a new fieldtype based on the textfield field type, like this:
public class AddressTextField : FieldType { public AddressTextField() { //Provider this.Id = new Guid("d8d89001-57ce-4b52-9005-c0c84f6651cb"); this.Name = "Validated address field"; this.Description = "Renders an text input field, for short answers"; //FieldType this.Icon = "icon-autofill"; this.DataType = FieldDataType.String; this.SortOrder = 13; this.SupportsRegex = true; this.FieldTypeViewName = "FieldType.AddressTextField.cshtml"; this.Category = "Custom"; } }
copy the field type views for Textfield and rename them as FieldType.AddressTextField.cshtml (views/forms/themes/default/fieldtypes) etc.
there are a number of views you need to add to make your own custom fieldtype, these are in the following locations:
but add an additional class property to the input field which you can use in a piece with something like https://twitter.github.io/typeahead.js/examples/ or similar.
see documentation here: https://our.umbraco.org/documentation/Add-ons/UmbracoForms/Developer/Extending/Adding-a-Fieldtype.
note: you'll need to install umbraco forms from nuget to access umbraco.forms.core
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Forms - is there a postcode lookup field for address?
Hi,
we want to add a field for postcode that will auto show s the addresses that the user can choose.
Is there anything in Umbraco Forms that does this?
Thanks!
no, but you can create your own.
you need to create a new fieldtype based on the textfield field type, like this:
copy the field type views for Textfield and rename them as FieldType.AddressTextField.cshtml (views/forms/themes/default/fieldtypes) etc.
there are a number of views you need to add to make your own custom fieldtype, these are in the following locations:
but add an additional class property to the input field which you can use in a piece with something like https://twitter.github.io/typeahead.js/examples/ or similar.
see documentation here: https://our.umbraco.org/documentation/Add-ons/UmbracoForms/Developer/Extending/Adding-a-Fieldtype.
note: you'll need to install umbraco forms from nuget to access umbraco.forms.core
is working on a reply...