Need help displaying checkboxes in a dialog box!!
Here is my code inside a jsp. If you can try it out you will see that all the checkboxes only display BELOW eachother. I NEED ROWS OF CHECKBOXES!! Why can't I do this in jquery dialog box?? (most of this code was from the jquery dialog website demo code)
- <meta charset="utf-8">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<link href="../master.css" rel="stylesheet" type="text/css">
<link href="../css/scheduler.css" rel="stylesheet" type="text/css">
<script src="../js/fx.js" type="text/javascript"></script>
<script src="../js/scheduler.js" type="text/javascript"></script>
<script src="../js/preferences.js" type="text/javascript"></script>
<script src="../js/matrices.js" type="text/javascript"></script>
<script src="../js/register.js" type="text/javascript"></script>
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/jquery-ui-1.8.6.custom.min.js" type="text/javascript"></script>
<script src="../js/jquery.ezCookie_0.7_min.js" type="text/javascript"></script>
<link href="../css/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" />
<link href="../css/jquery.simpledialog.0.1.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.simpledialog.0.1.js"></script>
</head>
</html>
<style>
body { font-size: 62.5%; }
label, input { display:block; }
input.text { margin-bottom:12px; width:95%; padding: .4em; }
fieldset { padding:0; border:0; margin-top:25px; }
h1 { font-size: 1.2em; margin: .6em 0; }
div#users-contain { width: 350px; margin: 20px 0; }
div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
.ui-dialog .ui-state-error { padding: .3em; }
.validateTips { border: 1px solid transparent; padding: 0.3em; }
</style>
<script>
$(function() {
// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Create an account": function() {
var bValid = true;
allFields.removeClass( "ui-state-error" );
bValid = bValid && checkLength( name, "username", 3, 16 );
bValid = bValid && checkLength( email, "email", 6, 80 );
bValid = bValid && checkLength( password, "password", 5, 16 );
bValid = bValid && checkRegexp( name, /^[a-z]([0-9a-z_])+$/i, "Username may consist of a-z, 0-9, underscores, begin with a letter." );
// From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
bValid = bValid && checkRegexp( email, /^((([a-z]|d|[!#$%&'*+-/=?^_`{|}~]|[ -豈-﷏ﷰ-])+(.([a-z]|d|[!#$%&'*+-/=?^_`{|}~]|[ -豈-﷏ﷰ-])+)*)|((")(((( | )*( ))?( | )+)?(([- -]|!|[#-[]|[]-~]|[ -豈-﷏ﷰ-])|(([- -]|[ -豈-﷏ﷰ-]))))*((( | )*( ))?( | )+)?(")))@((([a-z]|d|[ -豈-﷏ﷰ-])|(([a-z]|d|[ -豈-﷏ﷰ-])([a-z]|d|-|.|_|~|[ -豈-﷏ﷰ-])*([a-z]|d|[ -豈-﷏ﷰ-]))).)+(([a-z]|[ -豈-﷏ﷰ-])|(([a-z]|[ -豈-﷏ﷰ-])([a-z]|d|-|.|_|~|[ -豈-﷏ﷰ-])*([a-z]|[ -豈-﷏ﷰ-]))).?$/i, "eg. ui@jquery.com" );
bValid = bValid && checkRegexp( password, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9" );
if ( bValid ) {
$( "#users tbody" ).append( "<tr>" +
"<td>" + name.val() + "</td>" +
"<td>" + email.val() + "</td>" +
"<td>" + password.val() + "</td>" +
"</tr>" );
$( this ).dialog( "close" );
}
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
$( "#create-user" )
.button()
.click(function() {
$( "#dialog-form" ).dialog( "open" );
});
});
</script>
<div class="demo">
<div id="dialog-form" title="Student Availability">
<form id="checkboxForm">
#1. <input type="checkbox" class="chckbx" value="1" />
#2. <input type="checkbox" class="chckbx" value="2" />
#3. <input type="checkbox" class="chckbx" value="3" />
</form>
</div>
<button id="create-user">Specify Preferred Times</button>
</div><!-- End demo -->