Input

Package: Libraries.Web.Page · Inherits from: Libraries.Web.Page.AttributeAccepter, Libraries.Web.Page.KeyboardAttributeAccepter, Libraries.Web.Page.FormAttributeAccepter, Libraries.Web.Page.GlobalAttributeAccepter, Libraries.Web.Page.WebTag, Libraries.Language.Object, Libraries.Web.Page.MouseAttributeAccepter, Libraries.Web.Page.FlowContent

The Input class represents HTML's (Hypertext Markup Language) input tag which defines an input control within a Form. The type of control is defined by the type attribute. You can find more information about this tag at: The input attribute.

Example Code

use Libraries.Web.Page.all
class Main
action main
    //make a web page
    WebPage page
    //make a Form
    Form myForm
    //make a input
    Input myInput
    myInput:SetType("tel")
    myForm:Add(myInput)
    page:AddToBody(myForm)
end
end

Actions

Generate()

This action sets the width attribute. The width attribute specifies the width of an image input control.

Returns

text

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetWidth("15")

GetAccept()

This action gets the accept attribute. The value can be accessed by calling the GetValue() action on the returned accept attribute. It specifies the file types that will be accepted by the server. Multiple values are to be seperated by a coma. Accptable values: audio/* video/* image/* MIME_type

Returns

Libraries.Web.Page.Attribute: The accept attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute accept = myInput:GetAccept()
text acceptValue = ""
if accept not= undefined
    acceptValue = accept:GetValue()
end

GetAlternate()

This action gets the alternate attribute. The value can be accessed by calling the GetValue() action on the returned alternate attribute. The alternate specifies alternate text for images.

Returns

Libraries.Web.Page.Attribute: The alternate attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute alternate = myInput:GetAlternate()
text alternateValue = ""
if alternate not= undefined
    alternateValue = alternate:GetValue()
end

GetAutocomplete()

This action gets the value of the autocomplete attribute. Autocomplete is true by default. When true the browser will attempt to autocomplete the input field.

Returns

boolean: The autocomplete attribute value.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
boolean inputAutocomplete = myInput:GetAutocomplete()

GetAutofocus()

This action gets the value of the autofocus attribute. Autofocus is false by default. When true the browser place the focus on the input value when the page loads.

Returns

boolean: The autofocus attribute.

Example

use Libraries.Web.Page.Input
Input myInput
boolean inputAutofocus = myInput:GetAutofocus()

GetChecked()

This action gets the value of the checked attribute. The checked attribute is only valid when the input control is of type checkbox or radio. The default value is false. When true the radio button or checkbox will be checked after the page loads.

Returns

boolean: The checked attribute.

Example

use Libraries.Web.Page.Input
Input myInput
boolean inputChecked = myInput:GetChecked()

GetDefaultValue()

This action gets the defaultValue attribute. The value can be accessed by calling the GetValue() action on the returned defaultValue attribute. The defaultValue attribute specifies the default value of the input control.

Returns

Libraries.Web.Page.Attribute: The defaultValue attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute defaultValue = myInput:GetDefaultValue()
text defaultValueValue = ""
if defaultValue not= undefined
    defaultValueValue = defaultValue:GetValue()
end

GetDisabled()

This action gets the value of the disabled attribute. The default value is false. When true the input control will not be clickable. This is ignored when the input control is of type hidden.

Returns

boolean: The disabled attribute.

Example

use Libraries.Web.Page.Input
Input myInput
boolean inputDisabled = myInput:GetDisabled()

GetFormAction()

This action gets the formAction attribute. The value can be accessed by calling the GetValue() action on the returned formAction attribute. The formAction attribute specifies the address of the file that will process the input control when the form is submitted.

Returns

Libraries.Web.Page.Attribute: The formAction attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute formAction = myInput:GetFormAction()
text formActionValue = ""
if formAction not= undefined
    formActionValue = formAction:GetValue()
end

GetFormEncodedType()

This action gets the formEncodedType attribute. The value can be accessed by calling the GetValue() action on the returned formEncodedType attribute. The formEncodedType specifies the form encoding. Acceptable values: application/x-www-form-urlencoded multipart/form-data text/plain

Returns

Libraries.Web.Page.Attribute: The formEncodedType attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute formEncodedType = myInput:GetFormEncodedType()
text formEncodedTypeValue = ""
if formEncodedType not= undefined
    formEncodedTypeValue = formEncodedType:GetValue()
end

GetFormMethod()

This action gets the formMethod attribute. The value can be accessed by calling the GetValue() action on the returned formMethod attribute. The formMethod attribute specifies the protocol method in which the form data will be sent to the formAction address.

Returns

Libraries.Web.Page.Attribute: The formMethod attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute formMethod = myInput:GetFormMethod()
text formMethodValue = ""
if formMethod not= undefined
    formMethodValue = formMethod:GetValue()
end

GetFormName()

This action gets the formName attribute. The value can be accessed by calling the GetValue() action on the returned formName attribute. The formId attribute specifies the form the input is accociated with.

Returns

Libraries.Web.Page.Attribute: The formName attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute formName = myInput:GetFormName()
text formNameValue = ""
if formName not= undefined
    formNameValue = formName:GetValue()
end

GetFormNovalidate()

This action gets the value of the formNovalidate attribute. The default value is false. When true the form will not be validated upon submission. This attribute is only used for input controls of type submit.

Returns

boolean: The formNovalidate attribute.

Example

use Libraries.Web.Page.Input
Input myInput
boolean inputFormNovalidate = myInput:GetFormNovalidate()

GetFormTarget()

This action gets the formTarget attribute. The value can be accessed by calling the GetValue() action on the returned formTarget attribute. The formTarget attribute specifies which frame the form response is to be opened in. Acceptable Values: _blank _parent _top _self existing frame name

Returns

Libraries.Web.Page.Attribute: The formTarget attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute formTarget = myInput:GetFormTarget()
text formTarGetValue = ""
if formTarget not= undefined
    formTarGetValue = formTarget:GetValue()
end

GetHeight()

This action gets the height attribute. The value can be accessed by calling the GetValue() action on the returned height attribute. The height attribute is only used for input controls of type image and specifies the height of the image.

Returns

Libraries.Web.Page.Attribute: The height attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute height = myInput:GetHeight()
text heightValue = ""
if height not= undefined
    heightValue = height:GetValue()
end

GetImageAddress()

This action gets the imageAddress attribute. The value can be accessed by calling the GetValue() action on the returned imageAddress attribute. The imageAddress attribute specifies the address of the image input control.

Returns

Libraries.Web.Page.Attribute: The imageAddress attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute imageAddress = myInput:GetImageAddress()
text imageAddressValue = ""
if imageAddress not= undefined
    imageAddressValue = imageAddress:GetValue()
end

GetList()

This action gets the list attribute. The value can be accessed by calling the GetValue() action on the returned list attribute. The list attribute specifies the pre-defined datalist that is to be used by the input control.

Returns

Libraries.Web.Page.Attribute: The list attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute list = myInput:GetList()
text listValue = ""
if list not= undefined
    listValue = list:GetValue()
end

GetMax()

This action gets the max attribute. The value can be accessed by calling the GetValue() action on the returned max attribute. The max attribute specifies the maximum value for controls of type number, range, date, datetime, datetime-local, month, time and week.

Returns

Libraries.Web.Page.Attribute: The max attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute max = myInput:GetMax()
text maxValue = ""
if max not= undefined
    maxValue = max:GetValue()
end

GetMaxLength()

This action gets the maxLength attribute. The value can be accessed by calling the GetValue() action on the returned maxLength attribute. The maxLength attribute specifies the maximum number of characters allowed in an input control.

Returns

Libraries.Web.Page.Attribute: The maxLength attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute maxLength = myInput:GetMaxLength()
text maxLengthValue = ""
if maxLength not= undefined
    maxLengthValue = maxLength:GetValue()
end

GetMin()

This action gets the min attribute. The value can be accessed by calling the GetValue() action on the returned min attribute. The min attribute specifies the minimum value for controls of type number, range, date, datetime, datetime-local, month, time and week.

Returns

Libraries.Web.Page.Attribute: The min attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute min = myInput:GetMin()
text minValue = ""
if min not= undefined
    minValue = min:GetValue()
end

GetMultiple()

This action gets the value of the multiple attribute. The default value is false. When true the email or file control will accept multiple values.

Returns

boolean: The multiple attribute.

Example

use Libraries.Web.Page.Input
Input myInput
boolean inputMultiple = myInput:GetMultiple()

GetName()

This action gets the name attribute. The value can be accessed by calling the GetValue() action on the returned name attribute. The name attribute specifies the name of the input control.

Returns

Libraries.Web.Page.Attribute: The name attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute name = myInput:GetName()
text nameValue = ""
if name not= undefined
    nameValue = name:GetValue()
end

GetPattern()

This action gets the pattern attribute. The value can be accessed by calling the GetValue() action on the returned pattern attribute. The pattern attribute defines a regular expression for the input control when it is of type text, search, url, tel, email, or password.

Returns

Libraries.Web.Page.Attribute: The pattern attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute pattern = myInput:GetPattern()
text patternValue = ""
if pattern not= undefined
    patternValue = pattern:GetValue()
end

GetPlaceHolder()

This action gets the placeHolder attribute. The value can be accessed by calling the GetValue() action on the returned placeHolder attribute. The placeHolder attribute acts as a description of the desired input. It will be shown upon page load and dissappear when the value is edited. The placeHolder attribute is only used when the input control is of type text, search, url, tel, email, or password.

Returns

Libraries.Web.Page.Attribute: The placeHolder attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute placeHolder = myInput:GetPlaceHolder()
text placeHolderValue = ""
if placeHolder not= undefined
    placeHolderValue = placeHolder:GetValue()
end

GetReadOnly()

This action gets the value of the readOnly attribute. The default value is false. When true the input control's value cannot be modified.

Returns

boolean: The readOnly attribute.

Example

use Libraries.Web.Page.Input
Input myInput
boolean inputReadOnly = myInput:GetReadOnly()

GetRequired()

This action gets the value of the required attribute. The default value is false. When true the input control's value must be edited before submission.

Returns

boolean: The required attribute.

Example

use Libraries.Web.Page.Input
Input myInput
boolean inputRequired = myInput:GetRequired()

GetSize()

This action gets the size attribute. The value can be accessed by calling the GetValue() action on the returned size attribute. The size specifies the character width of an input control if it is of type text, search, tel, url, email, or password.

Returns

Libraries.Web.Page.Attribute: The size attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute size = myInput:GetSize()
text sizeValue = ""
if size not= undefined
    sizeValue = size:GetValue()
end

GetStep()

This action gets the step attribute. The value can be accessed by calling the GetValue() action on the returned step attribute. The step specifies the legal number intervals for the input control when it is of type number, range, date, datetime, datetime-local, month, time or week.

Returns

Libraries.Web.Page.Attribute: The step attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute step = myInput:GetStep()
text stepValue = ""
if step not= undefined
    stepValue = step:GetValue()
end

GetType()

This action gets the type attribute. The value can be accessed by calling the GetValue() action on the returned type attribute. The type attribute specifies the type of the input control. Acceptable values: button checkbox color date datetime datetime-local email file hidden image month number password radio range reset search submit tel text time url week

Returns

Libraries.Web.Page.Attribute: The type attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute type = myInput:GetType()
text typeValue = ""
if type not= undefined
    typeValue = type:GetValue()
end

GetWidth()

This action gets the width attribute. The value can be accessed by calling the GetValue() action on the returned width attribute. The width attribute specifies the width of an image input control.

Returns

Libraries.Web.Page.Attribute: The width attribute.

Example

use Libraries.Web.Page.Input
use Libraries.Web.Page.Attribute
Input myInput
Attribute width = myInput:GetWidth()
text widthValue = ""
if width not= undefined
    widthValue = width:GetValue()
end

SetAccept(text value)

This action sets the accept attribute. This value is only considered when the input type is file. It specifies the file types that will be accepted by the server. Multiple values are to be seperated by a coma. Accptable values: audio/* video/* image/* MIME_type

Parameters

  • value text: The accept of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetAccept("audio/*,text/txt")

SetAlternate(text value)

This action sets the alternate attribute. The alternate specifies alternate text for images.

Parameters

  • value text: The alternate of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetAlternate("Submit Button")

SetAutocomplete(boolean value)

This action sets the autocomplete attribute. Autocomplete is true by default. When true the browser will attempt to autocomplete the input field.

Parameters

  • value boolean: Boolean value that represents the autocomplete of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetAutocomplete(true)

SetAutofocus(boolean value)

This action sets the autofocus attribute. Autofocus is false by default. When true the browser place the focus on the input value when the page loads.

Parameters

  • value boolean: The autofocus of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetAutofocus(true)

SetChecked(boolean value)

This action sets the checked attribute. The checked attribute is only valid when the input control is of type checkbox or radio. The default value is false. When true the radio button or checkbox will be checked after the page loads.

Parameters

  • value boolean: The checked of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetChecked(true)

SetDefaultValue(text value)

This action sets the defaultValue attribute. The defaultValue attribute specifies the default value of the input control.

Parameters

  • value text: The defaultValue of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetDefaultValue("gender_female")

SetDisabled(boolean value)

This action sets the disabled attribute. The default value is false. When true the input control will not be clickable. This is ignored when the input control is of type hidden.

Parameters

  • value boolean: The disabled of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetDisabled(true)

SetFormAction(text value)

This action sets the formAction attribute. The formAction attribute specifies the address of the file that will process the input control when the form is submitted.

Parameters

  • value text: The formAction of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetFormAction("inputFormAction.quorum")

SetFormEncodedType(text value)

This action sets the formEncodedType attribute. The formEncodedType specifies the form encoding. Acceptable values: application/x-www-form-urlencoded multipart/form-data text/plain

Parameters

  • value text: The formEncodedType of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetFormEncodedType("application/x-www-form-urlencoded")

SetFormMethod(text value)

This action sets the formMethod attribute. The formMethod attribute specifies the protocol method in which the form data will be sent to the formAction address.

Parameters

  • value text: The formMethod of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetFormMethod("get")

SetFormName(text value)

This action sets the formName attribute. The formId attribute specifies the form the input is accociated with.

Parameters

  • value text: The formName of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetFormName("Input Form")

SetFormNovalidate(boolean value)

This action sets the formNovalidate attribute. The default value is false. When true the form will not be validated upon submission. This attribute is only used for input controls of type submit.

Parameters

  • value boolean: The formNovalidate of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetFormNovalidate(true)

SetFormTarget(text value)

This action sets the formTarget attribute. The formTarget attribute specifies which frame the form response is to be opened in. Acceptable Values: _blank _parent _top _self existing frame name

Parameters

  • value text: The formTarget of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetFormTarget("_blank")

SetHeight(text value)

This action sets the height attribute. The height attribute is only used for input controls of type image and specifies the height of the image.

Parameters

  • value text: The height of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetHeight("50")

SetImageAddress(text value)

This action sets the imageAddress attribute. The imageAddress attribute specifies the address of the image input control.

Parameters

  • value text: The imageAddress of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetImageAddress("go_button.jpg")

SetList(text value)

This action sets the list attribute. The list attribute specifies the pre- defined datalist that is to be used by the input control.

Parameters

  • value text: The list of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetList("input_list")

SetMax(text value)

This action sets the max attribute. The max attribute specifies the maximum value for controls of type number, range, date, datetime, datetime-local, month, time and week.

Parameters

  • value text: The max of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetMax("100")

SetMaxLength(text value)

This action sets the maxLength attribute. The maxLength attribute specifies the maximum number of characters allowed in an input control.

Parameters

  • value text: The maxLength of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetMaxLength("55")

SetMin(text value)

This action sets the min attribute. The min attribute specifies the minimum value for controls of type number, range, date, datetime, datetime-local, month, time and week.

Parameters

  • value text: The min of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetMin("9")

SetMultiple(boolean value)

This action sets the multiple attribute. The default value is false. When true the email or file control will accept multiple values.

Parameters

  • value boolean: The multiple of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetMultiple(true)

SetName(text value)

This action sets the name attribute. The name attribute specifies the name of the control.

Parameters

  • value text: The name of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetName("Male_Gender_Input")

SetPattern(text value)

This action sets the pattern attribute.The pattern attribute defines a regular expression for the input control when it is of type text, search, url, tel, email, or password.

Parameters

  • value text: The pattern of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetPattern("1?{{0..9}^3(-?)}^2{0..9}^4")

SetPlaceHolder(text value)

This action sets the placeHolder attribute. The placeHolder attribute acts as a description of the desired input. It will be shown upon page load and dissappear when the value is edited. The placeHolder attribute is only used when the input control is of type text, search, url, tel, email, or password.

Parameters

  • value text: The placeHolder of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetPlaceHolder("First Name")

SetReadOnly(boolean value)

This action sets the readOnly attribute. The default value is false. When true the input control's value cannot be modified.

Parameters

  • value boolean: The readOnly of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetReadOnly(true)

SetRequired(boolean value)

This action sets the required attribute. The default value is false. When true the input control's value must be edited before submission.

Parameters

  • value boolean: The required of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetRequired(true)

SetSize(text value)

This action sets the size attribute. The size specifies the character width of an input control if it is of type text, search, tel, url, email, or password.

Parameters

  • value text: The size of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetSize("50")

SetStep(text value)

This action sets the step attribute. The step specifies the legal number intervals for the input control when it is of type number, range, date, datetime, datetime-local, month, time or week.

Parameters

  • value text: The step of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetStep("5")

SetType(text value)

This action sets the type attribute. The type attribute specifies the type of the input control. Acceptable values: button checkbox color date datetime datetime-local email file hidden image month number password radio range reset search submit tel text time url week

Parameters

  • value text: The type of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetType("button")

SetWidth(text value)

This action sets the width attribute. The width attribute specifies the width of an image input control.

Parameters

  • value text: The width of the input.

Example

use Libraries.Web.Page.Input
Input myInput
myInput:SetWidth("15")

Inherited Actions

2 actions from Libraries.Language.Object
10 actions from Libraries.Web.Page.AttributeAccepter
20 actions from Libraries.Web.Page.FormAttributeAccepter
29 actions from Libraries.Web.Page.GlobalAttributeAccepter
6 actions from Libraries.Web.Page.KeyboardAttributeAccepter
32 actions from Libraries.Web.Page.MouseAttributeAccepter
8 actions from Libraries.Web.Page.WebTag