jQWidgets Forums
jQuery UI Widgets › Forums › Plugins › Validator, Drag & Drop, Sortable › How validate radiobutton of groupname
Tagged: jqxRadioButton, jqxvalidator, radio button, validate, validator
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 12 years, 3 months ago.
-
Author
-
hi
i want radiobutton validation. but i don’t know method validation of name
teach me radiobutton validate of groupname please
writed my javascript source in the bottom.
================= javascript source ================
var htmlCont = “”;
var comboObj = $(“#abc”);
$.each(jsonData, function(index, item) {
if(item.hasOwnProperty(resultvalue) && item.hasOwnProperty(resultId)){
htmlCont = htmlCont + “<div style=’margin-left: 10px; margin-top: 5px; float: left;’ class='”+ comboId + “‘ >” + eval(“item.” + resultId) + “</div>”;
}
});htmlCont = htmlCont + “<script type=’text/javascript’>”;
htmlCont = htmlCont + “$(‘.” + comboId + “‘).jqxRadioButton({ width: ’70’, height: ’20’, theme: theme, groupName :'” + comboId + “‘});”;
htmlCont = htmlCont + “</script>”;
comboObj.html(htmlCont);Hello kim il hyun,
Here is an example:
<!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxexpander.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxvalidator.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script> <script type="text/javascript" src="../../jqwidgets/globalization/jquery.global.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxmaskedinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxradiobutton.js"></script> <script type="text/javascript" src="../../scripts/gettheme.js"></script> <script type="text/javascript"> $(document).ready(function () { var theme = getDemoTheme(); $("#jqxRadioButton").jqxRadioButton({ width: 250, height: 25, theme: theme }); $("#jqxRadioButton2").jqxRadioButton({ width: 250, height: 25, theme: theme }); $("#jqxRadioButton3").jqxRadioButton({ width: 250, height: 25, theme: theme }); $("#jqxRadioButton4").jqxRadioButton({ width: 250, height: 25, theme: theme }); $('#form').jqxValidator({ rules: [{ input: '#jqxRadioButton', message: 'Select first option', action: 'change', rule: function () { var checked = $("#jqxRadioButton").jqxRadioButton("checked"); return checked; }, position: 'right:0,0' }], theme: theme }); $("#validate").click(function () { var button = $("#jqxRadioButton"); $('#form').jqxValidator('validate', button); }); }); </script></head><body class='default'> <form id="form" action=""> <div style='margin-top: 10px;' id='jqxRadioButton'> 12 Months Contract</div> <div style='margin-top: 10px;' id='jqxRadioButton2'> <span>6 Months Contract</span></div> <div style='margin-top: 10px;' id='jqxRadioButton3'> <span>3 Months Contract</span></div> <div style='margin-top: 10px;' id='jqxRadioButton4'> <span>1 Month Contract</span></div> </form> <button id="validate"> Validate</button></body></html>
We hope it is helpful to you.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.