Required input option?

Develop and Deploy Cross-Browser Web Apps .

Required input option?

Postby wahono77 » Sun Jun 02, 2013 1:26 pm

What's property in XUI widget which similiar with "required" attribute in form element in HTML?
What I mean is to force users to input some value in widget (not blank).

Thanks
wahono77
 
Posts: 90
Joined: Sat Apr 13, 2013 6:04 am

Re: Required input option?

Postby support » Mon Jun 03, 2013 12:53 am

   
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();
}
}
}
});
   
support
 
Posts: 346
Joined: Sat Apr 27, 2013 9:22 am

Re: Required input option?

Postby wahono77 » Tue Jun 04, 2013 5:01 am

Great, thank. I think it should in CodeSnaps.
wahono77
 
Posts: 90
Joined: Sat Apr 13, 2013 6:04 am


Return to CrossUI for Web Apps

Who is online

Users browsing this forum: No registered users and 0 guests

cron