ux set

Description

Provide a visual feedback to the input controls

Parameters

string

The control's id or name

string

The new status: show|hide|readonly|disabled|error|title|subtitle|clear

object

json object with all options

buttons

Apply the status to the attached buttons ( true|false)

bX

Apply the status to the attached button number X( true|false)

Return

object

The element

Example


<div id="set-example" class="preview"></div>
<script>
document.getElementById("set-example").innerHTML = ui.input( "User Name", "name", "", {placeholder:"Type your name", licon:"fa-user", rbutton:"fa-search" } )
 + ui.button( "set01", "set Error", {type:"is-link", link:"javascript:set01()", licon:"error"} )
 + ui.button( "set02", "set Disabled", {type:"is-link", link:"javascript:set02()", licon:"eye"} )
 + ui.button( "set03", "set Clear", {type:"is-link", link:"javascript:set03()", licon:"clean"} ) ;
 function set01() { ux.set("set-example","error"); }
 function set02() { ux.set("set-example","disabled"); }
 function set03() { ux.set("set-example","clear"); }
</script>

 

Preview:

UX_set_username