Textbox

Basic usage

<input type="hidden" id="name" />    
<script>
    aweui.txt({
        id: 'name',
        placeholder: 'type here...'
    });
</script>

Numeric textbox

<input type="hidden" id="numeric" value="123" />
<script>
    aweui.txt({
        id: 'numeric',
        numeric: true
    });
</script>

Formatting display value

The display value is shown when the textbox is not focused. You can show a display value that differs to the actual one, here's an example:
<input type="hidden" id="price" value="123" />
<script>
    aweui.txt({
        id: 'price',
        formatFunc: formatUSD
    });
    
    function formatUSD(val){
        return val + ' USD'; // the textbox will display '123 USD'
    }
</script>

Properties

id
input id
placeholder
textbox placeholder
formatFunc
function used to render the textbox display value
enb
enabled state (default true)
numeric
numeric textbox, accepts as value a
bool
or an options
object

Numeric options properties

decimals
number of decimals to allow,
0
for unlimited
step
numeric value to add/subtract when hitting up/down button
max
max value
min
min value ( default
0
)
allowNegative
allow negative numbers
showSpinners
show up/down buttons (default true)


Applies to all version



Comments
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our cookie policy and privacy policy .