How to make a custom element post its value during form submit?

76 Views Asked by At

I'm creating a custom element that wraps a third-party control. For some reason, I have to apply this 3rd-party control on a <div> instead on an <input> or else it will behave differently.

I'm using x-tag to create the custom element.

1

There are 1 best solutions below

2
On BEST ANSWER

You could insert a <input> tag with attribute type="hidden" and then duplicate the content of the <div> you want to post, it should work.

As an example, you can read this other post on SO.