I added a toggle switch custom to my datatable , using the following code :
function getdata(Request $request)
{
if(request()->ajax())
{
return datatables()->of(Casting::latest()->get())
->addColumn('action', function($data){
$button = '<table><tr><td>';
$button .= '<button type="button" name="edit" id="'.$data->id.'" class="edit btn btn-primary btn-sm">Modifier</button>';
$button .= '</td><td>';
$button .= ' <div class="custom-control custom-switch">';
$button .= ' <input type="checkbox" class="custom-control-input" id="switch1" name="example"';
if ($data->status == 1) {
$button .= "checked";
}
$button .= '><label class="custom-control-label" for="switch1">Toggle me</label>
</div>';
$button .= '</td></tr></table>';
return $button;
})
->rawColumns(['action'])
->make(true);
}
return view('Casting.castingss');
}
But I get a checkbox instead of a toggle switch custom.
EDIT
Now I get That :
But I can switch just the first row thr other rows stay fixed
hi u should define the div before the switch button like this
the css will be :
<style>
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
</style>
and the code will be :
<label class="switch">
<input type="checkbox">
<span class="slider"></span>
</label>
for exemple if u delete all the css i put in here and add let only the first
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
u will get only checkbox the u can edit it as u like with css :D i hope i helped u Good luck
Related
I have a popup notification that gets triggered when the customer adds an "out-of-stock" product to their cart. Right now, the popup appears for 2 seconds and then the page refreshes to the cart page. What I would like is the radio button on the form must be clicked and validated before closing the popup and THEN the cart page loads. I cannot figure out exactly how to write this in the javascript functions. Please take a look at the coding I have:
Add-to-cart button
<button
{% if product.empty? %}type="button"{% else %}type="submit"{% endif %}
{% if current_variant.inventory_quantity == 0 %}
class="btn btn--full add-to-cart.openButton"
onclick="openForm()"{% endif %}
name="add"
id="AddToCart-{{ section_id }}"
class="btn btn--full add-to-cart{% if enable_dynamic_buttons %} btn--secondary{% endif %}"
{% unless current_variant.available %} disabled="disabled"{% endunless %}>
Popup Notification HTML
<div class="loginPopup">
<div class="formPopup" id="popupForm">
<form action="/action_page.php" class="formContainer" onsubmit="return validate();">
<h2>This Product is</br><b style="color: #FF2629">OUT OF STOCK</b></h2>
<p>Unfortunately, this product is unavailable. By selecting the check box below, you agree to the acknowledgment that this product is not in-stock and the ETA for shipping is unknown at the time. </p>
<p><b>*Accept Acknowledgment</b></p>
<input type="radio" id="html" name="fav_language" value="HTML" onclick="validate()" required="required">
<label for="html">Agree (required to add to cart)</label>
<button type="submit" class="btn cancel" onclick="closeForm()">Submit</button></form>
Javascript and CSS
<script>
function openForm() {document.getElementById("popupForm").style.display = "block"; e.preventDefault();}
function validate()
{
if (document.getElementById('html').checked) {
return true;}
else {
alert("Unchecked form will not be submitted");
return false;
}
}
function closeForm() {
document.getElementById("popupForm").style.display = "none";
}
</script>
{% style %}
* {
box-sizing: border-box;
}
.openBtn {
display: flex;
justify-content: left;
}
.openButton {
border: none;
border-radius: 5px;
background-color: #1c87c9;
color: white;
padding: 14px 20px;
cursor: pointer;
position: fixed;
preventDefault();
}
.loginPopup {
position: relative;
text-align: center;
width: 100%;
}
.formPopup {
display: none;
position: fixed;
left: 45%;
top: 5%;
transform: translate(-50%, 5%);
border: 3px solid #999999;
z-index: 9;
}
.formContainer {
max-width: 600px;
padding: 20px;
background-color: #fff;
}
.formContainer input[type=radio],
{
width: 100%;
padding: 15px;
margin: 5px 0 20px 0;
border: none;
background: #eee;
}
.formContainer input[type=radio]:focus {
background-color: #ddd;
outline: none;
}
.formContainer .btn {
padding: 12px 20px;
border: none;
background-color: #8ebf42;
color: #fff;
cursor: pointer;
width: 100%;
margin-bottom: 15px;
opacity: 0.8;
}
.formContainer .cancel {
background-color: #143c8e;
}
.formContainer .btn:hover,
.openButton:hover {
opacity: 1;
}
{% endstyle %}
Ive tried all sorts of tutorials and then all seems to include this code.
<span class = ""> <i class=""><i/> <i class=""><i/> </span>
This dosen't seem to work,
Ive also tried this
</i>
It dosent seem to work. Please help, Thank you so much!.
IM using this rn
<nav class="navbar">
<div class="logo-box"><img src="../logos/foschini.png" class="logo"></div>
<ul>
<li>Hire an Engineer</li>
<li>Hiring</li>
<li>Plans</li>
<li>About us</li>
</ul>
<span class="hamburger">
<i class="bar">Hire</i>
<i class="bar">Hiring</i>
<i class="bar">Plans</i>
<i class="bar">About us</i>
</span>
</nav>
This is what I used:
scss:
$primary-color: #ffd000;
#SideMenuTrigger {
position: fixed;
right: 10em;
top: 50%;
transform: translateY(-50%);
transition: right 200ms;
width: 3.5em;
height: 3em;
border: none;
background: none;
padding: 0;
span {
position: absolute;
height: 18%;
background-color: $primary-color;
width: 100%;
transition: width 200ms, transform 200ms, opacity 200ms;
transition-timing-function: ease-in;
pointer-events: none;
right: 0;
opacity: 1;
&:nth-child(1) {
top: 0;
transform-origin: bottom right;
width: 90%;
}
&:nth-child(2) {
top: 50%;
transform: translateY(-50%);
width: 70%;
}
&:nth-child(3) {
bottom: 0;
transform-origin: top right;
width: 60%;
}
}
&:hover {
span {
&:nth-child(1) {
width: 100%;
}
&:nth-child(2) {
width: 50%;
}
&:nth-child(3) {
width: 65%;
}
}
}
&.is-open {
right: 2em;
span {
&:nth-child(1) {
width: 100%;
transform: rotateZ(-42deg);
}
&:nth-child(2) {
width: 100%;
transform: translate(20px, -50%);
opacity: 0;
}
&:nth-child(3) {
width: 100%;
transform: translateY(21%) rotateZ(42deg);
}
}
}
}
}%
html:
<button id="SideMenuTrigger">
<span></span>
<span></span>
<span></span>
</button>
if the menu is active add "is-open" class to button
I am using Laravel Log Reader
for viewing log files. It works fine.
But I also have other log files, how can I view them usig this viewer?
This package matching specific file pattern logs/laravel-*.log .So your mentioned log file doesn't match. This package doesn't have configuration to change it at present. But still if you want to view your own log files then you can override method and create your own view file.
I can provide you some basic idea and make sure i haven't written code in super clean.This is to get some idea
Custom class which is extended
<?php
namespace App\Helper;
class LaravelLogReader extends \Haruncpi\LaravelLogReader\LaravelLogReader
{
public function getLogFileDates()
{
$dates = [];
$files = glob(storage_path('logs/*.log'));
$files = array_reverse($files);
foreach ($files as $path) {
$fileName = basename($path);
array_push($dates, $fileName);
}
return $dates;
}
public function get()
{
$availableDates = $this->getLogFileDates();
if (count($availableDates) == 0) {
return response()->json([
'success' => false,
'message' => 'No log available'
]);
}
$configDate = $this->config['date'];
if ($configDate == null) {
$configDate = $availableDates[0];
}
if (!in_array($configDate, $availableDates)) {
return response()->json([
'success' => false,
'message' => 'No log file found with selected date ' . $configDate
]);
}
$pattern = "/^\[(?<date>.*)\]\s(?<env>\w+)\.(?<type>\w+):(?<message>.*)/m";
$fileName = $configDate;
$content = file_get_contents(storage_path('logs/' . $fileName));
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER, 0);
$logs = [];
foreach ($matches as $match) {
$logs[] = [
'timestamp' => $match['date'],
'env' => $match['env'],
'type' => $match['type'],
'message' => trim($match['message'])
];
}
$date = $fileName;
$data = [
'available_log_dates' => $availableDates,
'date' => $date,
'filename' => $fileName,
'logs' => $logs
];
return response()->json(['success' => true, 'data' => $data]);
}
}
and view file which is copied from library view .i have named it as log.blade.php
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Log Reader</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script>
var angularUrl = '{{asset('laravel-log-reader/angular.min.js')}}';
window.angular || document.write('<script src="' + angularUrl + '">\x3C/script>')
</script>
<style>
body {
margin: 0;
padding: 0;
background: #f4f4f4;
font-family: sans-serif;
}
.btn {
text-decoration: none;
background: antiquewhite;
padding: 5px 12px;
border-radius: 25px;
}
header {
min-height: 30px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
background: #3F51B5;
position: fixed;
left: 0;
right: 0;
top: 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
header .btn_clear_all {
background: #de4f4f;
color: #fff;
}
header .name {
font-size: 25px;
font-weight: 500;
color: white;
}
.content {
margin-top: 65px;
padding: 15px;
background: #fff;
min-height: 100px;
}
.content .date_selector {
min-height: 26px;
min-width: 130px;
border: 1px solid #ddd;
border-radius: 4px;
}
.top_content {
display: flex;
justify-content: space-between;
align-items: center;
}
.top_content .top_content_left {
display: flex;
}
.top_content .top_content_left .log_filter {
display: flex;
align-items: center;
margin-left: 15px;
}
.top_content .top_content_left .log_filter .log_type_item {
margin-right: 4px;
background: #eae9e9;
max-height: 20px;
font-size: 11px;
box-sizing: border-box;
padding: 4px 6px;
cursor: pointer;
}
.top_content .top_content_left .log_filter .log_type_item.active {
background: #2f2e2f;
color: white;
}
.top_content .top_content_left .log_filter .log_type_item.clear {
background: #607D8B;
color: white;
}
table {
border: 1px solid #ccc;
border-collapse: collapse;
margin: 0;
padding: 0;
width: 100%;
}
table tr {
border: 1px solid #e8e8e8;
padding: 5px;
}
table tr:hover {
background: #f4f4f4;
}
thead tr td {
background: #717171;
color: #fff;
}
table th,
table td {
padding: 5px;
font-size: 14px;
color: #666;
}
table th {
font-size: 14px;
letter-spacing: 1px;
text-transform: uppercase;
}
#media screen and (max-width: 700px) {
.top_content {
flex-direction: column;
}
.top_content .top_content_left {
flex-direction: column;
}
.top_content .log_filter {
flex-wrap: wrap;
}
.top_content .log_filter .log_type_item {
margin-bottom: 3px;
}
}
#media screen and (max-width: 600px) {
header {
flex-direction: column;
}
header .name {
margin-bottom: 20px;
}
.content {
margin-top: 90px;
}
.btn {
font-size: 13px;
}
.dt_box,
.selected_date {
text-align: center;
}
.responsive_table {
max-width: 100%;
overflow-x: auto;
}
table {
border: 0;
}
table thead {
display: none;
}
table tr {
border-bottom: 2px solid #ddd;
display: block;
margin-bottom: 10px;
}
table td {
border-bottom: 1px dotted #ccc;
display: block;
font-size: 15px;
}
table td:last-child {
border-bottom: 0;
}
table td:before {
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}
}
.badge {
padding: 2px 8px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
font-size: 11px;
}
.badge.info {
background: #6bb5b5;
color: #fff;
}
.badge.warning {
background: #f7be57;
}
.badge.critical {
background: #de4f4f;
color: #fff;
}
.badge.emergency {
background: #ff6060;
color: white;
}
.badge.notice {
background: bisque;
}
.badge.debug {
background: #8e8c8c;
color: white;
}
.badge.alert {
background: #4ba4ea;
color: white;
}
.badge.error {
background: #c36a6a;
color: white;
}
</style>
</head>
<body ng-controller="LogCtrl">
<header>
<div class="name">#{{ title }}</div>
<div class="actions">
<a class="btn btn_clear_all" href="#" ng-click="clearAll()">Clear All</a>
<a class="btn" href="{{url(config('laravel-log-reader.admin_panel_path'))}}">Goto Admin Panel</a>
<a class="btn" href="https://laravelarticle.com/laravel-log-reader" title="Laravel Log Reader">Doc</a>
</div>
</header>
<section class="content">
<div class="top_content">
<div class="top_content_left">
<div>
<p class="selected_date" style="font-size: 14px;"><strong>
<span ng-show="response.success">Showing Logs: #{{data.date}}</span>
<span ng-hide="response.success">#{{response.message}}</span>
</strong></p>
</div>
<div class="log_filter">
<div class="log_type_item" ng-class="selectedType==tp?'active':''"
ng-repeat="tp in logTypes track by $index"
ng-click="filterByType(tp)">#{{ tp }}
</div>
<div class="log_type_item clear" ng-show="selectedType" ng-click="selectedType=undefined">CLEAR FILTER
</div>
</div>
</div>
<div class="top_content_right">
<p class="dt_box">Select Date: <select class="date_selector" ng-model="selectedDate"
ng-change="init(selectedDate)">
<option ng-repeat="dt in data.available_log_dates"
value="#{{ dt }}">#{{ dt }}
</option>
</select>
</p>
</div>
</div>
<div>
<div class="responsive_table">
<table>
<thead>
<tr>
<td width="140">Timestamp</td>
<td width="120">Env</td>
<td width="120">Type</td>
<td>Message</td>
</tr>
</thead>
<tr ng-repeat="log in data.logs |filter: selectedType track by $index">
<td>#{{ log.timestamp }}</td>
<td>#{{log.env}}</td>
<td><span class="badge #{{ log.type.toLowerCase() }}">#{{ log.type }}</span></td>
<td>#{{ log.message }}</td>
</tr>
</table>
</div>
</div>
<script>
var myApp = angular.module("myApp", []);
myApp.controller("LogCtrl", function ($scope, $http) {
$scope.title = "Log Reader";
$scope.selectedType = undefined;
$scope.logTypes = ['INFO', 'EMERGENCY', 'CRITICAL', 'ALERT', 'ERROR', 'WARNING', 'NOTICE', 'DEBUG'];
var originalData = null;
$scope.init = function (date) {
var url = '';
if (date !== '' && date !== undefined) {
url = '{{url(config('laravel-log-reader.api_route_path'))}}?date=' + date
} else {
url = '{{url("custom-logger")}}'
}
alert(url);
$http.get(url)
.success(function (data) {
$scope.response = data;
$scope.data = data.data;
originalData = data.data;
})
};
$scope.init();
$scope.filterByType = function (tp) {
$scope.selectedType = tp
};
$scope.clearAll = function () {
if (confirm("Are you sure?")) {
var url = '{{url(config('laravel-log-reader.view_route_path'))}}'
$http.post(url, {'clear': true})
.success(function (data) {
if (data.success) {
alert(data.message);
$scope.init();
}
})
}
}
})
</script>
</section>
</body>
</html>
And add two routes
Route::get('custom-logger', function () {
$laravelLogReader=new \App\Helper\LaravelLogReader();
return $laravelLogReader->get();
});
Route::get('/log-viewer', function () {
return view('log');
});
Note: this not fully optimized code but you can write it in better way.This is only to show you can override the package
Another package you can use
Ref:https://github.com/rap2hpoutre/laravel-log-viewer
This package will read all log files and i have tested it it works fine
How can I add checkboxes to the options/dropdown list using customized Slick.Editor so that I am able to select multiple values from the dropdown list which is attached to click event on a column on grid?
/*
Dropdown with Multiple checkbox select with jQuery - May 27, 2013
(c) 2013 #ElmahdiMahmoud
license: http://www.opensource.org/licenses/mit-license.php
*/
$(".dropdown dt a").on('click', function() {
$(".dropdown dd ul").slideToggle('fast');
});
$(".dropdown dd ul li a").on('click', function() {
$(".dropdown dd ul").hide();
});
function getSelectedValue(id) {
return $("#" + id).find("dt a span.value").html();
}
$(document).bind('click', function(e) {
var $clicked = $(e.target);
if (!$clicked.parents().hasClass("dropdown")) $(".dropdown dd ul").hide();
});
$('.mutliSelect input[type="checkbox"]').on('click', function() {
var title = $(this).closest('.mutliSelect').find('input[type="checkbox"]').val(),
title = $(this).val() + ",";
if ($(this).is(':checked')) {
var html = '<span title="' + title + '">' + title + '</span>';
$('.multiSel').append(html);
$(".hida").hide();
} else {
$('span[title="' + title + '"]').remove();
var ret = $(".hida");
$('.dropdown dt a').append(ret);
}
});
body {
font: normal 14px/100% "Andale Mono", AndaleMono, monospace;
color: #fff;
padding: 50px;
width: 300px;
margin: 0 auto;
background-color: #374954;
}
.dropdown {
position: absolute;
top:50%;
transform: translateY(-50%);
}
a {
color: #fff;
}
.dropdown dd,
.dropdown dt {
margin: 0px;
padding: 0px;
}
.dropdown ul {
margin: -1px 0 0 0;
}
.dropdown dd {
position: relative;
}
.dropdown a,
.dropdown a:visited {
color: #fff;
text-decoration: none;
outline: none;
font-size: 12px;
}
.dropdown dt a {
background-color: #4F6877;
display: block;
padding: 8px 20px 5px 10px;
min-height: 25px;
line-height: 24px;
overflow: hidden;
border: 0;
width: 272px;
}
.dropdown dt a span,
.multiSel span {
cursor: pointer;
display: inline-block;
padding: 0 3px 2px 0;
}
.dropdown dd ul {
background-color: #4F6877;
border: 0;
color: #fff;
display: none;
left: 0px;
padding: 2px 15px 2px 5px;
position: absolute;
top: 2px;
width: 280px;
list-style: none;
height: 100px;
overflow: auto;
}
.dropdown span.value {
display: none;
}
.dropdown dd ul li a {
padding: 5px;
display: block;
}
.dropdown dd ul li a:hover {
background-color: #fff;
}
button {
background-color: #6BBE92;
width: 302px;
border: 0;
padding: 10px 0;
margin: 5px 0;
text-align: center;
color: #fff;
font-weight: bold;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<dl class="dropdown">
<dt>
<a href="#">
<span class="hida">Select</span>
<p class="multiSel"></p>
</a>
</dt>
<dd>
<div class="mutliSelect">
<ul>
<li>
<input type="checkbox" value="Apple" />Apple</li>
<li>
<input type="checkbox" value="Blackberry" />Blackberry</li>
<li>
<input type="checkbox" value="HTC" />HTC</li>
<li>
<input type="checkbox" value="Sony Ericson" />Sony Ericson</li>
<li>
<input type="checkbox" value="Motorola" />Motorola</li>
<li>
<input type="checkbox" value="Nokia" />Nokia</li>
</ul>
</div>
</dd>
<button>Filter</button>
</dl>
Are you looking for something like this
I am using watir-webdriver, I am trying to select one box from the HTML code below, for example "LC" for the input but I am having some troble to get it work. Anyone have any idea please. thanks
browser.checkbox(:value => 'LC').set
error message
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-2.0.4/lib/watir/element.rb:78:in `asse
rt_exists': Unable to locate element, using {:value=>"LC"} (Watir::Exception::Un
knownObjectException)
code
<TD align="right">Reason: </TD>
<TD><style type="text/css">
select, ul { height: 40px; overflow: auto; width: 205px; border: 1px solid #000; }
ul { list-style: none; margin: 0; padding: 0; overflow-x: hidden;}
li { margin: 0; padding: 0; }
ul li {
position: relative;
}
li ul {
position: absolute;
left: 149px;
top: 0;
display: none;
}
label { display: block; color: WindowText; background-color: Window; margin:0;
padding:0; width: 100%; }
label:hover { background-color: Highlight; color: HighlightText; display: block; }
</style>
<script type="text/javascript">
function appendValue(checkedValue) {
findFormElement("reason").value = ""
if(document.getElementById("CS").checked){
findFormElement("reason").value= findFormElemen"reason").value+document.getElementById ("CS").id;
}
if(document.getElementById("LC").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("LC").id;
}
if(document.getElementById("ND").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("ND").id;
}
if(document.getElementById("NG").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("NG").id;
}
if(document.getElementById("NC").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("NC").id;
}
if(document.getElementById("WD").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("WD").id;
}
};
</script>
<input name="reason" type="hidden" value></select><ul id="multisel">
<li><label for="CS"><input type="checkbox" name="CS" id="CS" onClick="appendValue ("CS")"/>Cannot Supply Within 2 Hours</label></li>
<li><label for="LC"><input type="checkbox" name="LC" id="LC" onClick="appendValue("LC")"/>Location Closed</label></li>
<li><label for="ND"><input type="checkbox" name="ND" id="ND" onClick="appendValue("ND")"/>No Drivers Available</label></li>
<li><label for="NG"><input type="checkbox" name="NG" id="NG" onClick="appendValue("NG")"/>No Vehicle Group Available</label></li>
<li><label for="NC"><input type="checkbox" name="NC" id="NC" onClick="appendValue("NC")"/>No Vehicles Available</label></li>
<li><label for="WD"><input type="checkbox" name="WD" id="WD" onClick="appendValue("WD")"/>Weekend Delivery</label></li>
</ul></TD>
select, ul { height: 40px; overflow: auto; width: 205px; border: 1px solid #000; }
ul { list-style: none; margin: 0; padding: 0; overflow-x: hidden;}
li { margin: 0; padding: 0; }
ul li {
position: relative;
}
li ul {
position: absolute;
left: 149px;
top: 0;
display: none;
}
label { display: block; color: WindowText; background-color: Window; margin: 0; padding: 0; width: 100%; }
label:hover { background-color: Highlight; color: HighlightText; display: block; }
</style>
<script type="text/javascript">
function appendValue(checkedValue) {
findFormElement("reason").value = ""
if(document.getElementById("CS").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("CS").id;
}
if(document.getElementById("LC").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("LC").id;
}
if(document.getElementById("ND").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("ND").id;
}
if(document.getElementById("NG").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("NG").id;
}
if(document.getElementById("NC").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("NC").id;
}
if(document.getElementById("WD").checked){
findFormElement("reason").value = findFormElement("reason").value + document.getElementById("WD").id;
}
};
</script>
<input name="reason" type="hidden" value></select><ul id="multisel">
<li><label for="CS"><input type="checkbox" name="CS" id="CS" onClick="appendValue ("CS")"/>Cannot Supply Within 2 Hours</label></li>
<li><label for="LC"><input type="checkbox" name="LC" id="LC" onClick="appendValue("LC")"/>Location Closed</label></li>
<li><label for="ND"><input type="checkbox" name="ND" id="ND" onClick="appendValue("ND")"/>No Drivers Available</label></li>
<li><label for="NG"><input type="checkbox" name="NG" id="NG" onClick="appendValue("NG")"/>No Vehicle Group Available</label></li>
<li><label for="NC"><input type="checkbox" name="NC" id="NC" onClick="appendValue("NC")"/>No Vehicles Available</label></li>
<li><label for="WD"><input type="checkbox" name="WD" id="WD" onClick="appendValue("WD")"/>Weekend Delivery</label></li>
</ul></TD>
The checkboxes don't have a value; however they each have an id. Try
browser.checkbox(:id => 'LC').set
In case you ended up here wanting to unselect the checbox, the method is clear