shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
generateIdFromForm
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.form
This function generate a uniqid based on the form element passed using these rules:
- If the form has an action attribute, this will be used to generate the uniqid.
- If not, the function will generate a uniqid based on the form attributes and named controls.
Note that the named controlls will be sorted before generating the uniqid.
Params
- $form*-HTMLFormElement
The form element to generate the uniqid from
Return
- -String
A uniqid
Example
import { generateIdFromForm } from '@blackbyte/sugar/dom';
const id = generateIdFromForm($myForm); // => a md5 hash idTodo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space