-
Notifications
You must be signed in to change notification settings - Fork 0
WD ATTR Vform Tool
wdonadelli edited this page Apr 27, 2022
·
3 revisions
The reference for how the attribute works is in the following tools:
The attribute's destination is the element itself (form) that contains it and the result influences the validity of the field in the requests and filling of the field.
the attribute value is the name of the check function that must be within the scope of window to be found.
The function accepts an argument where the element containing the attribute will be passed. After checking, if no undue value was found, the function should return null or undefined, otherwise, it should return the text with the error message.
<script>
/* Checks for prohibited names */
function myCheck(e) {
let list = [
"mario", "mary", "paul", "lucas", "maria", "alfred", "lisa"
];
let value = e.value.toLowerCase().trim();
if (list.indexOf(value) < 0 ) return null;
return value.toUpperCase() + " is not an allowed name.";
}
</script>
<form id="myForm">
<input data-wd-vform="myCheck" required="" type="text" name="name" placeholder="Enter a name"/>
<button type="button" data-wd-send="path{target.php}$${#myForm > *}" >Send</button>
</form>- WD Web Libraries | v4.4.4 | 2023-02-22
- Updated on 2023-02-22
- WD JS Array Tools
- WD JS Date Tools
- WD JS DOM Tools
- WD JS Number Tools
- WD JS Text Tools
- WD JS Time Tools
- WD ATTR Chart Tool
- WD ATTR Click Tool
- WD ATTR CSS Tool
- WD ATTR Data Tool
- WD ATTR Device Tool
- WD ATTR Edit Tool
- WD ATTR Filter Tool
- WD ATTR Full Tool
- WD ATTR Jump Tool
- WD ATTR Lang Tool
- WD ATTR Load Tool
- WD ATTR Mask Tool
- WD ATTR Nav Tool
- WD ATTR NoBubbles Tool
- WD ATTR Output Tool
- WD ATTR Page Tool
- WD ATTR Repeat Tool
- WD ATTR Send Tool
- WD ATTR Set Tool
- WD ATTR Shared Tool
- WD ATTR Slide Tool
- WD ATTR Sort Tool
- WD ATTR Tsort Tool
- WD ATTR Translate Tool
- WD ATTR URL Tool
- WD ATTR Vform Tool