Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
formjs
Advanced tools
Readme
Allows you easily re-style native form elements across all browsers and falls back to native form elements for mobile devices. Also, provides a simple API to manipulate form elements with javascript. Supports IE10+, all modern browsers, and mobile.
UI Elements include:
Let's say you wanted to style a dropdown menu with the following html:
<select>
<option value="MD">Maryland</option>
<option value="VA" selected>Virginia</option>
<option value="DC">Washington, DC</option>
</select>
With this library, you can do this:
var dropdown = new Dropdown({
el: document.getElementsByTagName('select')[0]
});
Which will change your HTML into this:
<div class="dropdown-wrapper">
<div class="dropdown-container">
<div class="dropdown-value-container">Virginia</div>
<div class="dropdown-option-container">
<div class="dropdown-option" data-value="MD">Maryland</div>
<div class="dropdown-option dropdown-option-selected" data-value="VA">Virginia</div>
<div class="dropdown-option" data-value="DC">Washington, DC</div>
</div>
</div>
<select>
<option value="MD">Maryland</option>
<option value="VA" selected>Virginia</option>
<option value="DC">Washington, DC</option>
</select>
</div>
Then you can style the dropdown using CSS (and just hide the <select>
element).
Each class comes with a set of utility methods so you can change the elements via JS. Using the example above, you could do the following:
// set the selected value programmatically
dropdown.setValue('DC');
// get the new data value
dropdown.getValue(); // => "DC"
// get the display value
dropdown.getDisplayValue(); // => "Washington, DC"
You can also listen to events on form elements. Given the following input element...
<input type="text" value="" placeholder="Enter text here" />
You can do the following:
var inputField = new InputField({
el: document.getElementsByTagName('input')[0],
onChange: function (el) {
// user has finished typing into the field!
},
onKeyDownChange: function (el) {
// the user has typed a key into the field!
}
});
// set the value
inputField.setValue('My text'); // set new value
// get the new value
inputField.getValue(); // => "My text"
Examples can be found in the examples page.
FAQs
Create better ui form elements. Supports IE9+, all modern browsers, and mobile.
The npm package formjs receives a total of 21 weekly downloads. As such, formjs popularity was classified as not popular.
We found that formjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.