PhotonUI logo

PhotonUI

A javascript framework to create user interfaces

TextField

Class Reference

More examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var grid = new photonui.GridLayout({
verticalSpacing: 5,
horizontalSpacing: 5,
children: [
new photonui.Label({
text: "Username:",
forInputName: "username-field",
layoutOptions: {
gridX: 0,
gridY: 0
}
}),
new photonui.TextField({
name: "username-field",
placeholder: "Username",
value: "Anakin",
layoutOptions: {
gridX: 1,
gridY: 0
}
}),
new photonui.Label({
text: "Password:",
forInputName: "password-field",
layoutOptions: {
gridX: 0,
gridY: 1
}
}),
new photonui.TextField({
name: "password-field",
type: "password",
placeholder: "password",
value: "D4RK51D3",
layoutOptions: {
gridX: 1,
gridY: 1
}
}),
new photonui.Button({
text: "Login",
leftIcon: new photonui.FAIcon("fa-sign-in"),
callbacks: {
click: function(widget, event) {
var usernameField = photonui.getWidget("username-field");
var passwordField = photonui.getWidget("password-field");
alert(
"Username: " + usernameField.value +
", Password: " + passwordField.value
);
}
},
layoutOptions: {
gridX: 0,
gridY: 2,
gridWidth: 2
}
})
]
});

photonui.domInsert(grid, "demo");