Libraryless. Click here for Pure Java version (2780L/18K).
1 | sS htrickcheckboxWithText(S name, S text, bool checked, O... params) { |
2 | S id = randomID(); |
3 | ret hhidden(name, checked ? "1" : "0") |
4 | + hcheckbox(null, checked, paramsPlus(params, +id, onclick := "this.previousElementSibling.value=this.checked ? 1 : 0")) |
5 | + " " + hlabelFor(id, htmlEncode2(text)); |
6 | } |
7 | |
8 | sS htrickcheckboxWithText(S name, S text) { |
9 | ret htrickcheckboxWithText(name, text, false); |
10 | } |
Began life as a copy of #1028495
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028657 |
Snippet name: | htrickcheckboxWithText - HTML checkbox with trick that sends 0 if unchecked |
Eternal ID of this version: | #1028657/3 |
Text MD5: | 6f5fba21ef6b09397d4d45aed385992c |
Transpilation MD5: | 8bcf8dd2a20ef2277df7808bd84ef186 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-07-02 12:44:25 |
Source code size: | 410 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 226 / 318 |
Version history: | 2 change(s) |
Referenced in: | [show references] |