![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@joinbox/formsync
Advanced tools
Synchronizes forms and elements between an original form (e.g. one created by Drupal) and another form (e.g. freely created as a template based on mockups).
Synchronizes forms and elements between an original form (e.g. one created by Drupal) and another form (e.g. freely created as a template based on crazy mockups). Needed as Drupal has strict limits on how filter forms are structured.
Features:
<form id="originalForm">
<label for="firstName">Your First Name:</label>
<input type="text" id="firstName" />
<div id="checkboxes">
<label for="fish"><input type="checkbox" id="fish" checked> Fish</label>
<label for="chicken"><input type="checkbox" id="chicken"> Chicken</label>
</div>
<!-- Without label -->
<select id="dropdown">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</form>
<!-- The cloned form -->
<div id="clonedForm">
<form-sync data-form-elements-selector="#firstName">
<template>
<!-- Template needs exactly one child -->
<div>
<!-- Original label's textContent is copied to textContent of element with
attribute data-label -->
<label data-label></label>
<!-- Original's element's value is copied to element with attribute data-input -->
<input type="text" data-input/>
</div>
</template>
</form-sync>
<form-sync data-form-elements-selector="#checkboxes input" data-auto-submit="change,submit,blur">
<div>
<h3>Checkboxes</h3>
<!-- One template will be cloned for every input in #checkboxes -->
<template>
<div>
<label>
<span data-label></span>
<input type="checkbox" data-input/>
</label>
</div>
</template>
</div>
</form-sync>
<form-sync data-form-elements-selector="#dropdown">
<template>
<div>
<!-- Options will be cloned from original <select> -->
<select data-input>
</select>
</div>
</template>
</form-sync>
<!-- Will submit #originalForm; gets class .active when #cloned is changed for the
first time-->
<form-submit-button
data-form-selector="#originalForm"
data-change-selector="#clonedForm"
data-changed-class-name="active"
>
<button>Submit</button>
</form-submit-button>
</div>
<script type="module" src="@joinbox/formsync/FormSyncElement.js"></script>
<script type="module" src="@joinbox/formsync/FormSubmitButtonElement.js"></script>
<form-sync></form-sync>
data-auto-submit
(optional): Use if certain events on the cloned input should auto-submit the
original form. Provide all events that should trigger the auto-submit as a comma delimited list,
e.g. "blur,input"
. If you want to auto-submit with a debounce, add the debounce after a colon in
ms, e.g. "input:50,blur"
(for a debounce of 50ms after an input). To submit the form, the
component will trigger a click on the original element's button
or input
with type="submit"
(this is required in order to work with Drupal's AJAX based forms).data-form-elements-selector
: CSS selector for all input elements that should be cloned and synced
between the original and the cloned input.data-submit-on-enter
(optional, boolean attribute): Submit original form if user presses enter
while the input is focused. Make sure the cloned form is not wrapped in a element or it will
be submitted at the same time (and reload the page if not prevented).<template>
tag to provide a template for the inputs that will be selected by
data-form-elements-selector
and cloned.<template>
tag must contain exactly one child.data-label
attribute within the template tag, if you wish. This
element's textContent
will be set to the original label's textContent
.data-input
attribute within the template tag. This
element's changed
or value
property will be synced with the original element.<form-submit-button></form-submit-button>
data-form-selector
(mandatory): CSS selector for the form element that should be submitted
when the current element is clicked.data-change-selector
(optional): CSS selector for a HTML element that should be watched for
change
and input
events; if any of those happens, data-changed-class-name
will be added to
the current form-submit-button
.Class that synchronizes two inputs (form elements). Example:
const sync = new InputSync();
sync.setup({
originalElement: document.querySelector('#source'),
clonedElement: document.querySelector('#target'),
originalProperty: 'value',
clonedProperty: 'value',
autoSubmit: ['change', 'input'],
});
Synchronizes the property value
of the two inputs #source
and #target
whenever a change event
occurs on one of them. When setup()
is called, also copies value
of original to cloned element
and calls submit()
on closest <form>
of originalElement
whenever a change
or input
event
occurs on the cloned element.
FAQs
Synchronizes forms and elements between an original form (e.g. one created by Drupal) and another form (e.g. freely created as a template based on mockups).
We found that @joinbox/formsync demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.