Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1003087 // htextinput - make HTML text input field. htextinput(name, [value,] autofocus := true, ...)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4203L/24K).

1  
// first element of params can be the value
2  
static S htextinput(S name, O... params) {
3  
  O value = "";
4  
  if (odd(l(params))) {
5  
    value = params[0];
6  
    params = dropFirst(params);
7  
  }
8  
  params = html_massageAutofocusParam(params);
9  
  ret tag("input", "", 
10  
    concatArrays(new O[] {"type", "text", "name", name, "value", value}, params));
11  
}
12  
13  
static S htextinput(S name) {
14  
  ret htextinput(name, "");
15  
}

Author comment

Began life as a copy of #1003086

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003087
Snippet name: htextinput - make HTML text input field. htextinput(name, [value,] autofocus := true, ...)
Eternal ID of this version: #1003087/9
Text MD5: 5b1b4ef7bff7bca3074363794c3e7263
Transpilation MD5: e9c82b9ac4bee6be850d2e52cb721504
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-24 18:57:17
Source code size: 416 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 689 / 775
Version history: 8 change(s)
Referenced in: [show references]