November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
For custom element you need mark it as:
class="Form__Element Form__CustomElement FormAddressElement
Then you need overide methods to get and bind its value (since it may contains multiple field). Please see the sample here: https://github.com/episerver/EPiServer.Forms.Samples/blob/master/ClientResources/ViewMode/EPiServerFormsSamples.js
Methods: bindCustomElementValue and getCustomElementValue.
Ah I think it makes sense why it wasn't working then with client header and footer scripts on, as the code in the GetSubmittedValue was greared up to get the values with no javascript at all, but effectively worked with javascript, but just not those two scripts.
I've done what you have recommended and have extended the episerver forms javascript and am seeing the values I want getting passed through so that's going to work.
Many thanks!
I've implemented several custom fields such as Address using the approach from EPiServer.Forms.Samples. This custom field has multiple input boxes for street, city, post code etc. I then set the values into a class and then convert to json. This has always worked great, until I tried adding to our layout the Client resource scripts for header and footer. Without the client resource scripts we always had a javascript error of epi is undefined, but it never affected anything so was ok with it.
The address model field has:
public class Address : InputElementBlockBase, IElementCustomFormatValue
When this bit runs on the submitting form:
it only ever has 1 component which is the first input box.
When I run the same code without the client resource header/footer scripts, the code will have my 7 components I am expecting. Is there a change I need to do to make it work with the client resource scripts?