2 attributes.data autoset
Florian Bouillon edited this page 1 month ago

data-autoset

import

import AutosetAttribute from '@dzeio/form-manager/attributes/AutosetAttribute'

am.register(AutosetAttribute)
am.setup()

When it is run

  • on form change
  • on form fill
  • on form mode switch

Possibilities

<input name="time" type="time" value="0" data-autoset="run:new Date().getTime()" /> <!-- Will always set it to the current date -->
<input name="text" type="text" value="0" data-autoset="hello-{world}" /> <!-- will fill the value with `hello-` and the value of the input world -->