Esempio n. 1
0
// InputTime creates a time based input box
func InputTime(id string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "time"
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 2
0
// InputColor creates a colour based input box, the workings of which are
// implementation specific
func InputColor(id string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "color"
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 3
0
// InputMonth creates a month based input box
func InputMonth(id string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "month"
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 4
0
// InputWeek creates a week based input box
func InputWeek(id string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "week"
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 5
0
// InputUpload creates an upload input field
func InputUpload(id string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "file"
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 6
0
// InputDateTimeLocal create a local datetime based input, the workings of
// which are implementation specific
func InputDateTimeLocal(id string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "datetime-local"
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 7
0
// InputURL is a text box that validates as a URL
func InputURL(id, value string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "url"
	i.Value = value
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 8
0
// InputPassword creates a password input
func InputPassword(id, value string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "password"
	i.Value = value
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 9
0
// InputButton creates a button input
func InputButton(id, name string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "button"
	i.Value = name
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 10
0
// InputCheckbox creates a checkbox input
func InputCheckbox(id string, value bool) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "checkbox"
	if id != "" {
		i.SetID(id)
	}
	i.Checked = value
	return i
}
Esempio n. 11
0
// InputText creates a text input box
func InputText(id, value string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "text"
	if id != "" {
		i.SetID(id)
	}
	i.Value = value
	return i
}
Esempio n. 12
0
// InputRadio create a radio button input
func InputRadio(id, name string, value bool) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "radio"
	i.Name = name
	if id != "" {
		i.SetID(id)
	}
	i.Checked = value
	return i
}
Esempio n. 13
0
// InputNumber creates a text input that only allows number to be entered
func InputNumber(id string, min, max, value float64) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "number"
	i.Min = strconv.FormatFloat(min, 'f', -1, 64)
	i.Max = strconv.FormatFloat(max, 'f', -1, 64)
	i.ValueAsNumber = value
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 14
0
// InputRange creates a sliding rule with which a number in the given range
// can be selected
func InputRange(id string, min, max, step, value float64) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "range"
	i.Min = strconv.FormatFloat(min, 'f', -1, 64)
	i.Max = strconv.FormatFloat(max, 'f', -1, 64)
	i.Value = strconv.FormatFloat(value, 'f', -1, 64)
	if step != step {
		i.Step = "all"
	} else {
		i.Step = strconv.FormatFloat(min, 'f', -1, 64)
	}
	if id != "" {
		i.SetID(id)
	}
	return i
}
Esempio n. 15
0
// InputSubmit creates a submit input
func InputSubmit(name string) *dom.HTMLInputElement {
	i := xdom.Input()
	i.Type = "submit"
	i.Value = name
	return i
}