Required option for input widget

Find code here before you post.

Required option for input widget

Postby linb » Wed Jun 05, 2013 11:49 am

Original post : required-input-option-t96.html

   
Class('App', 'xui.Com',{
Instance:{
iniComponents : function(){
// [[Code created by CrossUI RAD Tools
var host=this, children=[], append=function(child){children.push(child.get(0))};

append(
(new xui.UI.ComboInput)
.setHost(host,"ctl_comboinput7")
.setLeft(30)
.setTop(50)
.setWidth(240)
.setLabelSize(120)
.setLabelCaption("Required")
.setType("none")
.setTips("Required field")
.setTipsErr("Must be specified")
.setTipsOK("OK")
.setValueFormat("[^.*]")
.setCustomStyle({"LABEL":{"font-weight":"bold", "color":"#FF0000", "$gradients":""}})
);

append(
(new xui.UI.ComboInput)
.setHost(host,"ctl_comboinput6")
.setLeft(30)
.setTop(20)
.setWidth(240)
.setLabelSize(120)
.setLabelCaption("Optional")
.setType("none")
);

append(
(new xui.UI.SButton)
.setHost(host,"ctl_sbutton6")
.setLeft(150)
.setTop(90)
.setWidth(120)
.setCaption("Submit")
.onClick("_ctl_sbutton6_onclick")
);

return children;
// ]]Code created by CrossUI RAD Tools
},
_ctl_sbutton6_onclick : function (profile, e, src, value){
var ns = this;
var v2=ns.ctl_comboinput6.getUIValue();
var v2=ns.ctl_comboinput7.getUIValue();
if(!v2){
xui.message("'Required' field must be specified");
ns.ctl_comboinput7.activate();
}
}
}
});
   
linb
Site Admin
 
Posts: 102
Joined: Thu Apr 25, 2013 6:51 am

Return to CrossUI Code Snaps

Who is online

Users browsing this forum: No registered users and 0 guests

cron