lundi 31 octobre 2016

JQuery checkbox on Change not working in Safari

I am using the folowing code to select all or one-by-one select and saving checked checkboxes values into a object.

$(":checkbox.chbx-manage-select").on("change", function(e) {
            var st_lang_manag = {};

            $(":checkbox.chbx-manage-select").each(function(i,v) {
                st_lang_manag[v.value] = v.checked;
            });
          console.log(st_lang_manag);
        });

enter image description here

The code is working fine in Chrome and firefox but in safari 10.0.1 when I select all checkbox it saves false for all selected checkboxes in the object and when I unselect all checkbox it saves true for all unselected checkboxes in the object ( vice versa).

But when I select one by one it works fine.




How to mark a checkbox in a 2d array JAVA?

Im trying to mark an checkbox in a 2d ARRAY with this code

 checks [0] [1].setSelected(true);

And this is my 2d checkboxes array:

 // Creando Checkbox
     final int NUM_BOXES = 14; // named constant
JCheckBox[][] checks = new JCheckBox[NUM_BOXES][NUM_BOXES];
for (int i = 0; i < NUM_BOXES; i++) {
    for (int j = 0; j < NUM_BOXES; j++) {
        checks[i][j] = new JCheckBox("");
        this.add(checks[i][j]);
        checks [0] [1].setSelected(true);
    }
}

can someone help me?




Count number of selected checkboxes and display summary for each in php

need a little help in solving the problem with the counting of the responses checkboxes. There is a form of 10 questions each have 6 checkboxes with the ability to select multiple options. Possible answers A, B, C, D, E anB F. It is necessary to take all the responses and summarized in the form of A = 2, B = 4, C = 3, D = 1, E = 2, F = 0.

    <p>
    <label>1. QUESTION? </label><br>
    <label><input type="checkbox" name="checkbox-one[]" value="А">А</label>
    <label><input type="checkbox" name="checkbox-one[]" value="B">B</label>
    <label><input type="checkbox" name="checkbox-one[]" value="C">C</label>
    <label><input type="checkbox" name="checkbox-one[]" value="D">D</label>
    <label><input type="checkbox" name="checkbox-one[]" value="E">E</label>
    <label><input type="checkbox" name="checkbox-one[]" value="F">F</label>
    </p>

    <p>
    <label>2. QUESTION? </label><br>
    <label><input type="checkbox" name="checkbox-two[]" value="А">А</label>
    <label><input type="checkbox" name="checkbox-two[]" value="B">B</label>
    <label><input type="checkbox" name="checkbox-two[]" value="C">C</label>
    <label><input type="checkbox" name="checkbox-two[]" value="D">D</label>
    <label><input type="checkbox" name="checkbox-two[]" value="E">E</label>
    <label><input type="checkbox" name="checkbox-two[]" value="F">F</label>
    </p>

    <p>
    <label>3. QUESTION? </label><br>
    <label><input type="checkbox" name="checkbox-three[]" value="А">А</label>
    <label><input type="checkbox" name="checkbox-three[]" value="B">B</label>
    <label><input type="checkbox" name="checkbox-three[]" value="C">C</label>
    <label><input type="checkbox" name="checkbox-three[]" value="D">D</label>
    <label><input type="checkbox" name="checkbox-three[]" value="E">E</label>
    <label><input type="checkbox" name="checkbox-three[]" value="F">F</label>
    </p>
...

I think like this

$one = $_POST['checkbox-one'];
$two = $_POST['checkbox-two'];
$three = $_POST['checkbox-three'];
$four = $_POST['checkbox-four'];
$five = $_POST['checkbox-five'];
$six = $_POST['checkbox-six'];
$seven = $_POST['checkbox-seven'];
$eight = $_POST['checkbox-eight'];
$nine = $_POST['checkbox-nine'];
$ten = $_POST['checkbox-ten'];

$a = $one[0] + $two[0] + $three[0] + $four[0] + $five[0] + $six[0] + $seven[0] + $eight[0] + $nine[0] + $ten[0];
$b = $one[1] + $two[1] + $three[1] + $four[1] + $five[1] + $six[1] + $seven[1] + $eight[1] + $nine[1] + $ten[1];
$c = $one[2] + $two[2] + $three[2] + $four[2] + $five[2] + $six[2] + $seven[2] + $eight[2] + $nine[2] + $ten[2];
$d = $one[3] + $two[3] + $three[3] + $four[3] + $five[3] + $six[3] + $seven[3] + $eight[3] + $nine[3] + $ten[3];
$e = $one[4] + $two[4] + $three[4] + $four[4] + $five[4] + $six[4] + $seven[4] + $eight[4] + $nine[4] + $ten[4];
$f = $one[5] + $two[5] + $three[5] + $four[5] + $five[5] + $six[5] + $seven[5] + $eight[5] + $nine[5] + $ten[5];




How to use a check box to change a formula

I'm trying to toggle what data is included in a formula. I want to include a range of cells in the formula if the box is checked. If the box is not checked I do not want to include the data in the formula. I was trying to use VBA to do this but I am not really sure where to start. Thanks for any help in advance! Screen Shot of layout




Is it possible to get a Map object from the submission of a form with Checkboxes?

I have a form with a checkbox list read from a map object (using c:foreach). I would like to remap it from form, so I can use a single object for form values.

Is it possible to map Checkbox values to a Map value with Spring MVC or native Java Servlets?




When trying to remove from "list" I am getting an ArrayOutOfBoundsException index=-1. Android

I am trying to made an array of checkboxes in a Checkbox container. If the "other" checkbox is selected, then an edittext pops up asking for specification. I also need to grab the value of the checkboxes, which I currently do by grabbing the String value. When I attempt to remove the string value when unchecking a selection I get an out of bounds exception on the array. Where is the logic error in my code? I've been using various questions on here to try to put my program together. Here's the code

package com.stevenhoule.sportspsychologyquestionaire;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;

import java.util.ArrayList;
import java.util.List;


public class DEthnicityActivity extends AppCompatActivity {
    String placeHolder = "NA";
    String ethnicityHolder = "NA";
    public String items = "";

    public String getPlaceHolder() {
        return placeHolder;
    }

    public void setPlaceHolder(String placeHolder) {
        this.placeHolder = placeHolder;
    }

    public String getEthnicityHolder() {
        return ethnicityHolder;
    }

    public void setEthnicityHolder(String ethnicityHolder) {
        this.ethnicityHolder = ethnicityHolder;
    }



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ethnicity);

        final List<String> selectedEthnicity = new ArrayList<String>();
        selectedEthnicity.add(getString(R.string.ethnicity0));
        selectedEthnicity.add(getString(R.string.ethnicity1));
        selectedEthnicity.add(getString(R.string.ethnicity2));
        selectedEthnicity.add(getString(R.string.ethnicity3));
        selectedEthnicity.add(getString(R.string.ethnicity4));
        selectedEthnicity.add(getString(R.string.ethnicity5));
        selectedEthnicity.add(getString(R.string.ethnicity6));
        selectedEthnicity.add(getString(R.string.ethnicity7));
        selectedEthnicity.add(getString(R.string.ethnicity8));
        selectedEthnicity.add(getString(R.string.ethnicity9));
        selectedEthnicity.add(getString(R.string.ethnicity10));
        selectedEthnicity.add(getString(R.string.ethnicity11));
        selectedEthnicity.add(getString(R.string.ethnicity12));
        selectedEthnicity.add(getString(R.string.ethnicity13));
        selectedEthnicity.add(getString(R.string.ethnicity14));
        selectedEthnicity.add(getString(R.string.ethnicity15));
        selectedEthnicity.add(getString(R.string.ethnicity16));
        selectedEthnicity.add(getString(R.string.ethnicity17));
        selectedEthnicity.add(getString(R.string.ethnicity18));
        selectedEthnicity.add(getString(R.string.ethnicity19));

        final ArrayList<String> list = new ArrayList<>();
        final ViewGroup checkboxContainer = (ViewGroup) findViewById(R.id.checkbox_container);

        final EditText ethnicityText = (EditText) findViewById(R.id.ethnicity_text);
        ethnicityText.setVisibility(View.INVISIBLE);

        for (int i = 0; i < selectedEthnicity.size(); i++) {
            final CheckBox ethnicityCheckBox = new CheckBox(this);
            String t = selectedEthnicity.get(i);
            ethnicityCheckBox.setText(t);
            checkboxContainer.addView(ethnicityCheckBox);


            ethnicityCheckBox.setOnCheckedChangeListener
                    (new CompoundButton.OnCheckedChangeListener() {
                         @RequiresApi(api = Build.VERSION_CODES.KITKAT)
                         @Override
                         public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                             if (isChecked) {
                                 list.add(" " + buttonView.getText().toString());
                             } else {
                                 list.remove(list.indexOf(buttonView.getText().toString()));
                             }

                             //String items = "";
                             for (String item : list) {
                                 items += " " + item;
                                 if (list.contains(getString(R.string.ethnicity19))) {
                                     ethnicityText.setVisibility(View.VISIBLE);
                                     placeHolder = items
                                             + ethnicityText.getText().toString().trim();
                                 } else {
                                     ethnicityText.setVisibility(View.INVISIBLE);
                                     placeHolder = items;
                                 }

                             }
                         }


                     }

                    );
        }
    }

    public void backButton(View view) {
        Intent intent = new Intent(this, CPrimaryLanguageActivity.class);
        startActivity(intent);
    }

    public void nextQuestion(View view) {
        ethnicityHolder = placeHolder;
        String genderHolder = getIntent().getExtras().getString("gender");
        String ageHolder = getIntent().getExtras().getString("age");
        String languageHolder = getIntent().getExtras().getString("language");
        Intent intent = new Intent(this, EMarriageActivity.class);
        intent.putExtra("Gender", genderHolder);
        intent.putExtra("age", ageHolder);
        intent.putExtra("language", languageHolder);
        intent.putExtra("ethnicity", ethnicityHolder);
        startActivity(intent);

    }
}




Angular checkbox is unchecked even when attribute is present

I have a list of checkboxes and the first one basically empties an array and is checked when the array is empty

<input type="checkbox" data-ng-checked="groups.length == 0" data-ng-click="groups = []">

the problem is when I first click on the checkbox it's checked, when I click again on it, even if the array is empty and the checked attribute is present, the checkbox has the checked property false.

Is there a way to prevent this? I've tried to use $event.preventDefault() but that never changes the checkbox




Angular ng-model not updating when checkbox checked with jquery property

The code is trying to set a checked property through jquery .prop function. But ng-model is still blank.

$('document').ready(function(){
    $("#mybutton").on('click',function(){
        $("#mycheckbox").prop('checked',true);
    });
});

<input type="button" id="mybutton" value="click">
<input type="checkbox" id="mycheckbox" name="one" ng-model="arr[1]" value="1" />

   -- is blank when checked with jquery and not blank when manually checked.

When i manually check the checkbox then ng-model is binded and its value is set. Can you please help how to update ng-model when checkbox is checked with jQuery.




How create multi checkbox and receive question_id and responses_id in cakephp 3.0 controller

I'm creating multi checkbox and allow user to check them but in controller when I need to retrieve question_id and multi responses id, i get only single response id.

structure of data is following

 $options = array(
            array('6'=>'food','rsponses' => array('id' => 1, 'name' => 'asian'),array('id'=>'2', 'name'=>'european'),array('id'=>'3', 'name'=>'chinees') ),
            array('8'=>'hobbies' ,'responses' => array('id' => 1, 'name' => 'cricket'),array('id'=>'2', 'name'=>'reading'),array('id'=>'3', 'name'=>'watching TV') )
    );

Structure given below after debug easy to understand. In this 'food', 'hobbies' are question , i need id of these question and responses id against each question to save in database user response for each question. can you please give me any hint how to do this one.

[
    (int) 0 => [
        (int) 6 => 'food',
        'rsponses' => [
            'id' => (int) 1,
            'name' => 'asian'
        ],
        (int) 7 => [
            'id' => '2',
            'name' => 'european'
        ],
        (int) 8 => [
            'id' => '3',
            'name' => 'chinees'
        ]
    ],
    (int) 1 => [
        (int) 8 => 'hobbies',
        'responses' => [
            'id' => (int) 1,
            'name' => 'cricket'
        ],
        (int) 9 => [
            'id' => '2',
            'name' => 'reading'
        ],
        (int) 10 => [
            'id' => '3',
            'name' => 'watching TV'
        ]
    ]
]

To display question and checkbox for user, I'm unig this code

foreach ($options as $responses => $responsesOptions) {
    $legend = $this->Html->tag('legend', $responses);
    $checkboxes = $this->Form->select($responses, $responsesOptions, [
        'name' => 'field',
        'multiple' => 'checkbox'
    ]);
    echo $this->Html->tag('fieldset', $legend . $checkboxes);
}




checkbox with ng-repeat not working

I got a list of levels when someone clicks on the levels I need to call the method in AngularJs.When I click on the checkbox nothing is happening, but when I click on the checkbox outside the ng-repeat is working fine. This is my code.

<div class="col-md-4">
                        <label>Select Level:</label>
                        <div ng-repeat="level in vm.Levels | filter: {Workshop:true}">

                            <div class="i-checks">
                                <input type="checkbox" ng-model="level.Name" id="level-" icheck />
                                <label class="control-label">
                                    
                                </label>
                            </div>
                        </div>
                        <input type="checkbox" />

                    </div>

Thanks in advance.




dimanche 30 octobre 2016

Multiples checkboxes same .click function

Apologies for my lack of knowledge, I'm sure this is one of those simple fix solutions.

I have a number of checkboxes in my web page. When you check a check box a value of 1 is sent to a variable.

See example:

  $('#abilitytobenonjudgemental').click(function(){ 
    var check = document.getElementById("abilitytobenonjudgemental").checked
    if (check == true) {
    job2 += 1;
    job3 += 1;
    job7 += 1;
    workSkillsCheckboxCount += 1;  
    console.log(workSkillsCheckboxCount);   
   }
    else if (check == false) {
    job2 -= 1;
    job3 -= 1;
    job7 -= 1;
    workSkillsCheckboxCount -= 1; 
    console.log(workSkillsCheckboxCount);

  }
   });

A number of the checkboxes' functions double up and I would like to write a big function, rather than a number of functions. This function below doesn't seem to work.

   $('#teamwork, #goodcommunicator, #self-motivated, #computerskills,      #planning, #selfmanagement, #flexibleteamplayer, #timedeadlines').click(function()     { 
       var check = document.getElementById("teamwork, goodcommunicator,      planning, self-motivated, computerskills, selfmanagement, flexibleteamplayer, timedealines").checked
     if (check == true) {
     job1 += 1; 
     job2 += 1;
     job3 += 1;
     job4 += 1;
     job5 += 1;
     job6 += 1;
     job7 += 1;
     job8 += 1;
     workSkillsCheckboxCount += 1; 
     console.log(workSkillsCheckboxCount);
 }
    else if (check == false) {
     job1 -= 1; 
     job2 -= 1;
     job3 -= 1;
     job4 -= 1;
     job5 -= 1;
     job6 -= 1;
     job7 -= 1;
     job8 -= 1;
     workSkillsCheckboxCount -= 1; 
     console.log(workSkillsCheckboxCount);

 }
 }); 

I tried giving the appropriate checkboxes a class and then wrote this function. But that doesn't seem to be sending the values to the workSkillsCheckboxCount variable.

  $('.group1').click(function(){ 
        var check = document.getElementsByClassName("group1").checked
    if (check == true) {
    job1 += 1; 
    job2 += 1;
    job3 += 1;
    job4 += 1;
    job5 += 1;
    job6 += 1;
    job7 += 1;
    job8 += 1;
    workSkillsCheckboxCount += 1; 
    console.log(workSkillsCheckboxCount);
}
    else if (check == false) {
    job1 -= 1; 
    job2 -= 1;
    job3 -= 1;
    job4 -= 1;
    job5 -= 1;
    job6 -= 1;
    job7 -= 1;
    job8 -= 1;
    workSkillsCheckboxCount -= 1; 
    console.log(workSkillsCheckboxCount);

}
});




Working the check box laravel 5.2

I am having problem working my check box basically am trying to save in a diff location if checkbox is true don't know what am doing wrong here is my code.Error displays

FatalErrorException in PostController.php line 64:syntax error, unexpected 'if' (T_IF)

thanks in advance.

creat.blade`

            <div>
                
                

            </div>

Postcontroller`

<?php 
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Input;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Post;
use Session;

use Image;
class PostController extends Controller
{
    public function __construct() {
        $this->middleware('auth');
    }

    public function store(Request $request)
    {
        // validate the data
        $this->validate($request, array(
                'title'         => 'required|max:255',
                'body'          => 'required'
            ));
        // store in the database
        $post = new Post;
        $post->title = $request->title;
        $post->body = $request->body;
        $checkbox = Input::get('check_box');

        $post->$checkbox

        if ($request->hasFile('featured_image')) {

          $image = $request->file('featured_image');
          $filename = time() . '.' . $image->getClientOriginalExtension();

            if (Input::get('check_box') === 'true') {
                $post->checkbox = 'true';  // UPDATE:must be true of course
                $location = public_path('images/profile' . $filename);
              Image::make($image->getRealPath())->resize('800', '400')->save($location);

            $post->image = $filename;

            } else {
                $post->checkbox = 'false'; // UPDATE:must be false of course
                $location = public_path('images/' . $filename);
              Image::make($image->getRealPath())->resize('800', '400')->save($location);


          $post->image = $filename;

        }

        $post->save();

        Session::flash('success', 'The blog post was successfully save!');
        return redirect()->route('posts.show', $post->id);
    }
    public function show($id)
    {
        $post = Post::find($id);
        return view('posts.show')->withPost($post);}
?>




How to make the checkbox to cover 100% width and 100% height of a sqaure container?

I've been able to place a checkbox on top of a dynamically sized (responsive) div but now I need to make it so that the checkbox covers 100% width and 100% height of this div.

Here is my codepen: http://ift.tt/2f7hKFG where at the moment I just temporarily hardcoded the width and the height of the checkbox.

HTML:

<div id="container">
  <input type="checkbox">
  <img src="http://ift.tt/29IYa3F">
</div>

CSS:

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#container {
  width: 50%;
  border: solid 4px tomato;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

input {
  position: absolute;
  width: 100px;
  height: 100px;
  opacity: 0.75;
}




Remove lastIndexOf url with checkboxes

I'm trying to create a 2checkout buy now button. In order to get the correct products into the cart, you need to pass product ID's into the URL. I'm trying to build the URL based on how the user checks and unchecks checkboxes.

For example:

When the user checks a checkbox, a URL parameter is added to the base URL using &product_id=

$("#buynow").attr('href', function(){
    var baseURL = this.href;
    var newURL = baseURL + '&product_id=' + productID;
    return newURL;
})

The user unchecks the checkbox, therefore, removing the product ID from the URL:

$("#buynow").attr('href', function(){
    var oldURL = this.href;
    var newURL = oldURL.substr(oldURL.lastIndexOf('&'));
    return url.replace( new RegExp(oldURL), '' );
})

The problem I'm having is that I have multiple checkboxes that add and remove to the URL.

Typical scenerio:

User checks checkbox A product_id=1, and then checks checkbox B product_id1=2.

http://ift.tt/2e2CcGD

User decided to uncheck checkbox A. The code removes the lastIndexOf based on '&' which then removes checkbox B product ID.

How can I write the code such that it removes not just the last parameter added to the URL, however, it knows which product to remove based on the ID of the product.

Hope this makes sense.




forge_fdf checkbox exception

The following works fine if I only fill in the fields of the PDF (i.e. the boolean_a field is an empty list). But if I add entries to the list for checkboxes, I get the exception given below.:

field_a = [[b'Date Prepared', 'October 30, 2016']]
boolean_a = [[b'Check Box1', 'Yes']]

form = 'form.pdf'
fdf = 'temp.fdf'
output = 'output.pdf'
write_sect(field_a, boolean_a, fdf, form, output)


def write_sect(fields, booleans, fdf, form, output):

    forged_fdf = forge_fdf('', fields, booleans, [], [])

    with open(fdf, 'wb') as tmp_fw:
        tmp_fw.write(forged_fdf)

    call('pdftk "{0}" fill_form "{1}" output "{2}" dont_ask'.format(form, fdf, output))

    return

I get the following error:

Unhandled Java Exception in create_output():
java.lang.ClassCastException: pdftk.com.lowagie.text.pdf.PdfNull cannot be cast to pdftk.com.lowagie.text.pdf.PdfDictionary
   at 0x0059a84e (Unknown Source)
   at 0x0059ad42 (Unknown Source)
   at 0x005e9bd4 (Unknown Source)
   at 0x005ba4a4 (Unknown Source)
   at 0x005b2044 (Unknown Source)
   at 0x0059231e (Unknown Source)
   at 0x004723f1 (Unknown Source)
   at 0x00472045 (Unknown Source)
   at 0x004df3e2 (Unknown Source)
   at 0x004df38a (Unknown Source)
   at 0x00471e74 (Unknown Source)




Nested table checkbox check/Uncheck

I have a page with nested table and checkbox for checking all the table cell . And checkbox for each table cell for checking respective cell.

What I'm trying to do is

  1. CheckAll checkbox checks/uncheck all the parent and child checkbox
  2. Uncheck a parent checkbox unchecks CheckALL checkbox and unchecks all the child checkbox
  3. Check a parent checkbox checks all child checkbox and finds out if all other parent checkbox are checked or not, to check CheckALL checkbox
  4. checking a child checkbox should check the respective parent
  5. unchecking a child checkbox should check if siblings are checked, if not checked parent checbox should get unchecked and if checkALL checkbox is checked it should get unchecked too.

I'm unable to do this.

Here is what I have tried.

html:

<table class="table table-striped tablesorter">
  <thead>
    <tr colspan="2">
      <th>
        <input type="checkbox" id="checkedAll">
      </th>
      <th>Check/UnCheck ALL Boxes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <input type="checkbox" class="checkParent">
      </td>
      <td>1KWT</td>

    </tr>
    <tr>
      <td colspan="2" style="padding: 0">
        <table class="innertable" style="margin: 10px 0px 10px 50px;border: 1px solid #d0d0d0">
          <thead>
            <tr>
              <th></th>
              <th>Sub</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td>
                <input type="checkbox" class="checkChild" style="margin-top: -3px"> </td>
              <td>1KWT1</td>
            </tr>
            <tr>
              <td>
                <input type="checkbox" class="checkChild" style="margin-top: -3px"> </td>
              <td>1KWT2</td>
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <input type="checkbox" class="checkParent" style="margin-top: -3px"> </td>
      <td>1OMN</td>
    </tr>
    <tr>
      <td colspan="2" style="padding: 0">
        <table class="innertable" style="margin: 10px 0px 10px 50px;border: 1px solid #d0d0d0">
          <thead>
            <tr>
            <th></th>
              <th>Sub</th>
             </tr>
          </thead>
          <tbody>
            <tr>
              <td>
                <input type="checkbox" class="checkChild" style="margin-top: -3px"> </td>
              <td>1OMN1</td>
            </tr>
            <tr>
              <td>
                <input type="checkbox" class="checkChild" style="margin-top: -3px"> </td>
              <td>1OMN2</td>
             </tr>
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>

script:

$(document).ready(function() {

  $("#checkedAll").change(function(){
    if(this.checked){
      $(".checkParent, .checkChild").each(function(){
        this.checked=true;
      });              
    }else{
      $(".checkParent, .checkChild").each(function(){
        this.checked=false;
      });              
    }
  });

  $(".checkParent").click(function () {
    if ($(this).is(":checked")){
      var isAllChecked = 0;
      $(".checkParent").each(function(){
        if(!this.checked)
           isAllChecked = 1;
      }) 
      $(".checkChild").prop("checked", true);
      if(isAllChecked == 0){ $("#checkedAll").prop("checked", true); }     
    }else {
      $("#checkedAll, .checkChild").prop("checked", false);

    }
  });

  $(".checkChild").click(function () {
    if ($(this).is(":checked")){
    $(".checkParent").prop("checked", true);

    }else {
      $(".checkParent").prop("checked", false);

    }
  });


});

link to fiddle http://ift.tt/2ftPUHY




Determining if checkbox is checked in Ionic 2

How can I determine if a ion-checkbox is checked in Ionic 2.

   <ion-item *ngFor="let a of q.Answers">
      <ion-label></ion-label>
      <ion-checkbox (click)="addValue($event)" [(ngModel)]="a.checked"></ion-checkbox>
   </ion-item>

the following return undefined

 addValue(e): void {
     var isChecked = e.currentTarget.checked;
     console.log(isChecked);//undefined

 }




jQuery UI check checkbox when div shown with toggle

I am using jQuery UI's toggle to show/hide divs. I am trying to have a hidden checkbox check when the div is shown and uncheck when the div is hidden. I think this should be possible however I cannot figure it out.




samedi 29 octobre 2016

SelectAll checkboxs not working in app but works in kendo dojo

I have ran into an issue with selecting all checkboxes in a grid, the problem isn't so much on how to do it, the is why isn't it working in my app, but meanwhile works when I created here

I have a kendo window popping up and its content is a partialview, here is the partialview

<div class="row">
    <div class="form-horizontal">
        <div id="tasksGrid"></div>
    </div>
</div>

<script src="~/Scripts/Customjs/Orders/LoadTasksForProjectJS.js"></script>

and the script that you see becing referenced is..

$(document).ready(function () {
    LoadTasksForProject();

    $("#SelectAll").change(function () {
        var status = this.checked; 
        $(':checkbox').each(function () { 
            this.checked = status; 
        });
    });
});

function GetSelectedIds() {
    var idsToSend = [];
    var grid = $("#tasksGrid").data("kendoGrid")
    var ds = grid.dataSource.view();

    for (var i = 0; i < ds.length; i++) {
        var row = grid.table.find("tr[data-uid='" + ds[i].uid + "']");
        var checkbox = $(row).find(".checkbox");
        if (checkbox.is(":checked")) {
            idsToSend.push(ds[i].ScheduleTaskID);
        }
    }
    alert(idsToSend);
}

function LoadTasksForProject() {
    $.ajax({
        type: "GET",
        url: "../Orders/GetScheduleTasks",
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (data, textStatus, jqXHR) {
            ShowTasksForProject(data);
        }
    });
}

function ShowTasksForProject(tasksdata) {
    $('#tasksGrid').kendoGrid({
        noRecords: {
            template: "No Data Available"
        },
        dataSource: {
            data: tasksdata
        },
        schema: {
            model: {
                id: "ScheduleTaskID"
            }
        },
        columns: [
               { title: "<input type='checkbox' id='SelectAll' />", template: "<input type='checkbox'>", width: "30px" },
               { field: "ScheduleTaskID", title: "ScheduleTaskID", hidden: true },
               { field: "Task", title: "Task" }
        ],
        scrollable: true,
        pageable: false,
        selectable: "row"
    }).data("kendoGrid");
}

So if you take a look at the dojo I made, it is pretty much the same thing as what you see going on here. For the life of me I can't figure out why the SelectAll won't get hit when I select the uppermost checkbox, I have put an alert in it to see if I was hitting it and maybe something was wrong with the code, but no alert, I even tried having a console.log in the SelectAll change event and nothing at all.

So I am kinda confused on what I am missing, any idea's or reasons why it will work in the link provided but not on here?




How can I change the border thickness of an Android checkbox?

The default size of the android checkboxes were too small for my purposes, so I changed their overall size, however with their new size their borders now are horribly thick.

In what way could I change the thickness? I quite like the default behavior of the checkboxes, so the only thing I would like to change is the thickness of the border.




Checkbox doesn't display as checked (CSS)

The checkboxes doesn't display as checked, after I've modified their appearances with CSS. The checkboxes does check though, since the values collects in the summary of the form. So it's just a matter of CSS I believe. Moreover, unchecked and hover states work(!), which makes it weirder to me.

Here's a snippet of the HTML code (it continues like this for each option).

                <!-- image gallery -->
                <div style="display:none;">
                  <div class="uifm-dcheckbox-item-gal-imgs">
                    <a data-inp17-opt2-index="0" href="http://ift.tt/2dYhyHG" class="uifm-dcheckbox-item-imgsrc" title="image 1" data-gallery=""> <img src="http://ift.tt/2dYhyHG"></a>
                  </div>
                </div>
                <canvas data-uifm-nro="0" width="100" height="100" class="uifm-dcheckbox-item-viewport"></canvas>
              </div>
            </div>
            <div data-backend="0" data-gal-id="blueimp-gallery5" data-opt-label="Val 2" data-opt-checked="0" data-opt-price="0" data-opt-qtyst="0" data-opt-qtymax="2" data-inp17-opt-index="1" data-toggle="tooltip" data-placement="bottom" data-html="true"
            title="Val 2" class="uifm-dcheckbox-item">
              <div class="uifm-dcheckbox-item-wrap">
                <div class="uifm-dcheckbox-item-chkst btn-default"> <i class="fa fa-square-o"></i> </div>
                <div style="display:none" class="uifm-dcheckbox-item-qty-wrap">
                  <div class="input-group"> <span class="input-group-btn"> <button type="button" class="btn btn-default" data-value="decrease"> <span class="glyphicon glyphicon-minus"></span> </button>
                    </span> <span class="input-group-btn"> <input type="text" data-max="2" data-min="1" class="uifm-dcheckbox-item-qty-num" value="1"> </span> <span class="input-group-btn"> <button type="button" class="btn btn-default" data-value="increase"> <span class="glyphicon glyphicon-plus"></span>                        </button>
                    </span>
                  </div>
                </div>
                <div class="uifm-dcheckbox-item-nextimg btn-primary"> <i class="fa fa-chevron-right"></i> </div>
                <div class="uifm-dcheckbox-item-previmg btn-primary"> <i class="fa fa-chevron-left"></i> </div>
                <div style="display: none;">
                  <input class="uifm-dcheckbox-item-chkval" name="uiform_fields[ui3brbw6kci][1]" type="checkbox" value=""> </div>

Here's my CSS modifications:

.uifm-dcheckbox-item-viewport {
  margin: -10px;
  cursor: pointer;
  background-size: contain;
  background-repeat: no-repeat;
  display: inline-block;
  width: 100px;
  height: 70px;
  -webkit-transition: all 100ms ease-in;
  -moz-transition: all 100ms ease-in;
  transition: all 100ms ease-in;
  -webkit-filter: brightness(1.8) grayscale(1) opacity(.7);
  -moz-filter: brightness(1.8) grayscale(1) opacity(.7);
  filter: brightness(1.8) grayscale(1) opacity(.7);
  -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.uifm-dcheckbox-item-viewport:hover {
  -webkit-filter: brightness(1.2) grayscale(.5) opacity(.9);
  -moz-filter: brightness(1.2) grayscale(.5) opacity(.9);
  filter: brightness(1.2) grayscale(.5) opacity(.9);
}

.uifm-dcheckbox-item-viewport input:checked {
  -webkit-filter: none;
  -moz-filter: none;
  filter: none;
}

.fa.fa-square-o {
  visibility: hidden;
}

.uifm-dcheckbox-item-chkst.btn-default {
  visibility: hidden;
}

Probably it has something to do with :checked. I'm not a coder, so I'm using a 3rd party plug-in with Wordpress. I know this is possible with CSS3 only, since the code works by itself. Likely I've just missed something obvious.

Regards,




In Twitter Bootstrap 3 button (checkbox) remains gray after it is unchecked

I use Twitter Bootstrap 3 and have this code:

<div class="btn-group" id="day-group" data-toggle="buttons">
    <label class="btn btn-default">
        <input name="fruits" id="apple" value="1" type="checkbox" />Apple
    </label>
    <label class="btn btn-default">
        <input name="fruits" id="orange" value="2" type="checkbox" />Orange
    </label>
</div>

I click on the "Apple" and that button (checkbox) is gray. It is checked now.

Then I click on the "Apple" again. It is unchecked now. But it is still gray. Only if I click somewhere else it will be white, so I can see, that checkbox is unchecked.

I want to see white button (checkbox) right after it is unchecked, without having to click somewhere else. How could I achieve that? jQuery, css or other ways?




Set checkbox in simple_list_item_checked from Cursor

I am beginner in Android developing.

I have a ListView of type android.R.layout.simple_list_item_checked and I am trying to set the checkbox to value, which is in my Cursor under name "CHECKED". The problem is that I cannot find the id of the checkbox (I have tried android.R.id.checkbox, but it hasn't worked) and I don't know, how to set it based on my Cursor. The cursor is created from SQLite database table, where the "CHECKED" column is BOOLEAN type.

My code, which is not working:

lv.setAdapter(
                new SimpleCursorAdapter(MainActivity.this, android.R.layout.simple_list_item_checked, mCursor,
                        new String[]{"NOTES", "CHECKED"}, new int[]{android.R.id.text1, android.R.id.checkbox}, 0));

Could you help me, please? Thanks in advance.




vendredi 28 octobre 2016

How to implement an MDL data-selectable table inside a form

I have an MDL selectable table:

<form action="/counselors//badges/add" method="post">
  <table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
    <thead>
      <tr>
        <th class="mdl-data-table__cell--non-numeric">Name</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="mdl-data-table__cell--non-numeric"></td>
      </tr>
    </tbody>
  </table>
<!-- submit button, etc -->
</form>

The table has checkboxes but in. However, the mdl-data-table--selectable class is what adds the checkboxes. How can i use these checkboxes as inputs for my form? there just needs to be a checkbox for each row in the table.




WPF - how to databind multiple listbox items from the same dataset

I have 4 listbox items that are containing checkbox items. I am trying to bind them from the same Dataset but it seems I am not doing it right.

Also I would like to know if I bind checkboxes this way, how do I later access to ID values from database that are selected (since I only set Content and I didn't set selectedValuePath or something like that)?

Here is my code below:

XML

   <ListBox x:Name="grejanjeListBox" ItemsSource="{Binding}" DataContext="WinnerBazaDataSet" HorizontalAlignment="Left" Height="52" Margin="141,264,0,0" VerticalAlignment="Top" Width="307" SelectionMode="Multiple">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox x:Name="grejanjeCheckBox"  Content="{Binding NacinGrejanja}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Label Content="Tip Objekta:" HorizontalAlignment="Left" Margin="30,323,0,0" VerticalAlignment="Top"/>
        <ListBox x:Name="tipObjektaListBox" ItemsSource="{Binding}" HorizontalAlignment="Left" Height="26" Margin="141,323,0,0" VerticalAlignment="Top" Width="307">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox x:Name="tipObjektaCheckBox" Content="{Binding TipObjekta}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Label Content="Opis Objekta:" HorizontalAlignment="Left" Margin="31,366,0,0" VerticalAlignment="Top"/>
        <ListBox x:Name="opisObjektaListBox" ItemsSource ="{Binding}" HorizontalAlignment="Left" Height="52" Margin="142,366,0,0" VerticalAlignment="Top" Width="307">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox x:Name="opisObjektaCheckBox" Content="{Binding OpisObjekta}"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Label Content="Dodatno:" HorizontalAlignment="Left" Margin="31,437,0,0" VerticalAlignment="Top"/>
        <ListBox x:Name="dodatnoListBox" ItemsSource ="{Binding}" HorizontalAlignment="Left" Height="52" Margin="142,437,0,0" VerticalAlignment="Top" Width="307">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <CheckBox x:Name="dodatnoCheckBox" Content="{Binding Dodatno}" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

C#

private void Window_Loaded_1(object sender, RoutedEventArgs e)
    {
        WinnerBazaDataSet wds = new WinnerBazaDataSet();
        GrejanjeTableAdapter gta = new GrejanjeTableAdapter();
        TipObjektaTableAdapter tta = new TipObjektaTableAdapter();
        OpisObjektaTableAdapter ota = new OpisObjektaTableAdapter();
        DodatnoTableAdapter dta = new DodatnoTableAdapter();
        gta.Fill(wds.Grejanje);
        tta.Fill(wds.TipObjekta);
        ota.Fill(wds.OpisObjekta);
        dta.Fill(wds.Dodatno);
        this.DataContext = wds.Grejanje;
        this.DataContext = wds.TipObjekta;
        this.DataContext = wds.OpisObjekta;
        this.DataContext = wds.Dodatno;
    }




WPF c# CheckBox Combobox background color + disable

I have a combobox which has checkboxes as items.

I´m trying to disable as well as change the background color of some checkboxes.

I´m doing so:

foreach (System.Windows.Controls.CheckBox item in cmbMnMe.Items)
{
    item.IsEnabled = false;
    item.Background = new SolidColorBrush(Color.FromRgb(102, 153, 255));
}

But it still enabled to check as well as the background color didn´t change.




How to set JavaFX CheckBox value in a TableView Column?

I am trying to get 'Active' value from 'Information' class and set it to TableView Column as Checkbox, so user can edit. I have following in my controller:

  activeColumn.setCellValueFactory(new PropertyValueFactory<Information, Boolean>("Active"));

activeColumn.setCellValueFactory(new PropertyValueFactory<Information, Boolean>("Active"));
            final Callback<TableColumn<Information, Boolean>, TableCell<Information, Boolean>> cellFactory = CheckBoxTableCell.forTableColumn(activeColumn);
            activeColumn.setCellFactory(new Callback<TableColumn<Information, Boolean>, TableCell<Information, Boolean>>() {
                @Override
                public TableCell<Information, Boolean> call(TableColumn<Information, Boolean> column) {
                    TableCell<Information, Boolean> cell = cellFactory.call(column);
                    cell.setAlignment(Pos.CENTER);
                    return cell ;
                }
            });
            activeColumn.setCellFactory(cellFactory);
            activeColumn.setEditable(true);

Here is my 'Information' class where I'm getting Active value as true/false

public Information(Hashtable information) {
    :::

    String strActive = cvtStr(information.get("Active"));
            if (strActive.equals("1"))
                this.active = true;
            else if (strActive.equals("0"))
                this.active = false;
}
 public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

When I run it I'm not getting the Checkbox checked where 'Active' is true. Here is the screenshot:

enter image description here

Would any one tell me where am I doing wrong? Or is there any other ways to get this done?

Any help would be greatly appreciated




EF: Databinding checkbox to nullable int value

I am wondering if there is a way of handling nullable values of type int when binding to a CheckBox in Winforms.

Take the following example class:

public class TestClass
{
    public Nullable<int> NULLABLE_INT_VALUE { get; set; }
    public int NON_NULLABLE_VALUE { get; set; }
}

I have a component which inherits from the standard checkbox and allows you to pass an object (i.e. the class instance) and a property name and will set a DataBinding against the checkbox:

public void FSetDataBinding(object BindingObject, string FieldName)
{
    Binding ControlBinding = new Binding("Checked", BindingObject, FieldName) { NullValue = false };
    ControlBinding.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
    ControlBinding.Format += (s, e) => { e.Value = e.Value.ToString() == "1"; };
    ControlBinding.Parse += FormDBCheckBox_Parse;
    DataBindings.Add(ControlBinding);
}

private void FormDBCheckBox_Parse(object sender, ConvertEventArgs e)
{
    if((bool)(e.Value))
    {
        e.Value = "1";
    }
    else
    {
        e.Value = "0";
    }
}

If I create two checkbox controls (chkNullableValue and chkNonNullableValue respectively), I can bind them to a TestClass (we're assuming here that TestClass is an EF version of the database table:

TestClass IAmATest = new TestClass() { NULLABLE_INT_VALUE = 1, NON_NULLABLE_VALUE = 0 }
chkNullableValue.FSetDataBinding(IAmATest, "NULLABLE_INT_VALUE");
chkNonNullableValue.FSetDataBinding(IAmATest, "NON_NULLABLE_VALUE");

Both properties are from the same object and are bound in exactly the same way; however, when I try and check the box which is bound to the nullable value, for some reason the (set;) accessor is never hit against the property. What happens is that, on the form, the box appears to be checked; however, since the underlying property against the box has not been updated, the next time it formats the control for display, e.Value is still "0" and the box will 'un-check' itself. This also means that calling SaveChanges() doesn't update the value, as it has technically never been updated.

It's also important to note here: Yes, it's true that NullValue = false against the Binding that is created; however, in this specific case, the nullable value already has a value of "0" and so will never actually be null (but it could be in other cases).

The opposite is true for the non-nullable property and this behaves exactly as I would expect; when you check the box on the form, the value of NON_NULLABLE_VALUE is updated and set to "1" as part of FormDBCheckBox_Parse, so the next time the control formats itself, ControlBinding.Format returns "true" and the checked property is set accordingly.

As I'm of the opinion that if something is a flag (and therefore either 'off' or 'on' at all times) then null values shouldn't be allowed against the field in the database and so in the end I just made the value non-nullable; however, I want to understand exactly why I had so much trouble using the nullable type in case I need to use it in future for anything else.




Write user slections to access database via datagridview

I don't know the best way to do this, but this is what I have attempted. I'm open to suggestions.

This is an engineering change request form. On the form - I have a datagridview that is populated by an access database to display a list of product series. I then edit the dgv and add an unbound checkbox column. On a new request, the user needs to select all series that the change request will affect. I need to iterate through and find all of the checked series, then filter or populate a second dgv with all of the models within those series, and add an unbound checkbox column for those. then they s




Javascript add/remove textbox when checking/unchecking a checkbox (Razor HTML)

I have this checkbox, and I want to add a textbox and label when it is checked and hide them when it becomes unchecked. how would one go about doing that with JS or Jquery ?

<div class="form-group">
        @Html.LabelFor(model => model.OwnVehicle, "Eget Køretøj", htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.CheckBoxFor(model => model.OwnVehicle, new { htmlAttributes = new { @class = "form-control"} })
            @Html.ValidationMessageFor(model => model.OwnVehicle, "", new { @class = "text-danger" })
            <div id="holder">


            </div>
        </div>
    </div>




Local Storage item is not checked the checkbox

I am trying to save multiple select values in local storage and the data is setting and getting successfully in and from local storage but the box is not checked by the jquery. Here is the fiddle of my code and below is the jquery code i am using

$('.cmn').on('click', function() {
            var fav, favs = [];
            $('.cmn').each(function() { // run through each of the checkboxes
            fav = {class: $(this).attr('class'), value: $(this).prop('checked')};
                //console.debug(fav);
                favs.push(fav);
            });
            localStorage.setItem("payment", JSON.stringify(favs));
        });

        $(document).ready(function() {
            var payment = JSON.parse(localStorage.getItem('payment'));

            if (!payment.length) {return};
            //console.debug(payment);

            for (var i=0; i<payment.length; i++) {
                console.debug(payment[i]);
                //alert("."+payment[i].class);
                $("."+payment[i].class).prop('checked', payment[i].value);
            }
        });




How can I bind a onclick event to a checkbox INSTEAD of a change event?

Here is the problem I have.

I'm making a control panel for some devices. Now the user can enable/toggle an on/off switch (checkbox) and so can a remote device. This is reflected in the database. However, I also want a confirm box whenever the user (NOT the device) toggles to enable the device (checkbox == checked). No confirmation box required for when the user disables (toggles off, checkbox==false) the device. I check the database every few seconds to see the state of device (since the device can turn itself on or off)

This is what I have so far (It doesn't work correctly. Nothing is sent to the database. on click doeesn't fire on user click in checkbox)

$(function() {
    $('#toggle').bootstrapToggle({
      on: TR_Toggle_On,
      off: TR_Toggle_Off
    });
    check_enable();

    function check_enable() {
        var timer = setInterval(function(result) {
            $.ajax({
                type: "get",
                url: "checkState.php",
                success: function(result) {
                    var enabled =parseInt(result);
                    if (enabled ===1) {
                        $( '#toggle').bootstrapToggle('on');
                    } else {
                        $( '#toggle').bootstrapToggle('off');
                    }
                }
            });
        }, 5000);
    }

    $('#toggle').on('click',function(){
        $('#toggle').change(function() {
            if ($('#toggle').prop('checked') ===true) {
                if(confirm("Sure?")){
                    $.ajax({
                    type: "get",
                    url: "setEnable.php",
                    data: "enable=1"
                    });
                }else{
                    $('#toggle').prop('checked',false);
                }
            } else {
                $.ajax({
                    type: "get",
                    url: "setEnable.php",
                    data: "enable=0"
                });
            }
        })
    })


})

How can I do this? When I try to register the on('click',func(){}) event, nothing fires. I assume it doesn't work for checkboxes? What am I doing wrong?




Laravel- Handling multiple checkboxes in pivot tables

I have been struggling with this for a while, am a new developer with very little experience. So am working on a project dealing with drugs and diseases. There exists a many to many relationship.

Drug model

public $timestamps=false;

public function disease()
{
    return $this->belongsTo('App\Disease');
}

Disease model

public $timestamps=false;

public function drug()
{
    return $this->belongsTo('App\Drug');
}

I want to create relationships in the Disease_Drug pivot table using forms. form.blade.php

 <label>Disease</label>
   <select class="form-inline input-sm " name="disease" id="disease">
        @foreach($diseases as $key => $disease)
           <option value=""> </option>
        @endforeach
   </select>

 <label>Drugs</label><br>
        @foreach($drugs as $key=>$drug)
           <input type="hidden" name="drug[]" value="0" />
           <input class="checkbox-inline" type="checkbox" name="drug[]"value="" id=""> <br>
        @endforeach

  <button type="submit" class="btn btn-primary">Submit</button>

I have a disease_drug controller

public function form()
{
    $diseases = Disease::all();
    $drugs = Drug::all();

    return view('admin.form')
        ->with('diseases', $diseases)
        ->with('drugs', $drugs);

}
public function store(Request $request)
{
    $diseases = $request->get('diseases.ids');
    $drugs = $request->get('drugs.id', []); // Empty array by default if no checkbox checked.
    $diseases->drugs()->sync($request->input('drugs', []));
}

I am unable to save the results in the database. I am really clueless on this so kindly help me out.




Get Selected Checkbox on Grid View to Controller

I have a grid under foreach statement. This foreach statement has an HTML input checkbox column.

My problem is, I am able to populate my rows and grid properly. All input fields are okay even the checkbox attributes were okay but I cannot get all the "checked" checkbox to pass into the controller as Model.

Here is my HTML/View code:

<input type="checkbox" class="chkEmployee" name="lngEmployeeID" value="="@Model.lngEmployeeID"></input>

And this is my JQuery code:

function fncBulkApprove() {

        $('#btnEdit').unbind();
        $('#btnEdit').on('click', function(e) {
             e.preventDefault();
             var objData = $('form').serialize();
            $.ajax({
                url: '@Url.Action("fncBulkEdit", Model)',
                type: 'POST',
                datatype: 'application/JSON',
                data: objData,
                beforeSend: function () {
                },
                complete: function (request, status) {
                },
                success: function (result) {
                    $('#divEdit').dialog('open');
                },
                error: function (request, status, error) {
                }
            });                   
            });                
    }

On my controller, I am passing my Model as parameter:

[HttpPost]
    public PartialViewResult fncBulkEdit(entEmployee objModel)
    {
        return PartialView("_Edit");
    }

The list of IDs on the model are declared under:

public virtual IList<long> lngEmployeeID { get; set; }

How will I am able to pass all checked checkboxes as IList IDs to my controller?




jeudi 27 octobre 2016

how to add items dynamically in custom ListView without erasing previous items

i am fetching some data from php url and showing that data on Custom ListView. In 'category' listView, user will select a category checkbox and further according to selected item i am sending id of that item from another url to fetch 'subCategories' and i am showing that sub category items in another listView. But the problem is whenever i click on another checkbox the subCategory items replaced by the newly fetched items.. i want to show all subcategories corresponding to selected 'category' checkboxes... Please Please help me how can i do that? here is onClickListener for 'category' checkbox.

    holder.name.setOnClickListener( new View.OnClickListener() {
                    public void onClick(View v) {
                        CheckBox cb = (CheckBox) v ;
                        Category Category = (Category) cb.getTag();
                    /*Toast.makeText(getApplicationContext(),"Clicked on Checkbox: " + cb.getText() +" is " + cb.isChecked(),
                            Toast.LENGTH_LONG).show();*/
                        category_id=cb.getText().toString();
                        receiveSubCategory();
                        Category.setSelected(cb.isChecked());
                    }
                }); 

Here is how i am getting values. private void receiveSubCategory(){

    StringRequest stringRequest = new StringRequest(Request.Method.POST,Sub_Cate_URL,new Response.Listener<String>() {
        @Override
        public void onResponse(String response) {
            //Log.d("sub response", response);
            receiveSubJSOn(response);
        }
    },
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    String er=error.getMessage();
                    Toast.makeText(UpdateUserProfile.this,er,Toast.LENGTH_LONG).show();
                    //Log.d("","error message"+er);
                }
            }){

    @Override
    protected Map<String,String> getParams(){
        Map<String,String> params = new HashMap<String, String>();
        params.put("category_id",category_id);
        return params;
    }

};


RequestQueue requestQueue = Volley.newRequestQueue(this);
    requestQueue.add(stringRequest);
}

private void receiveSubJSOn(String json){
    ParseJSON pj = new ParseJSON(json);
    pj.receiveSubCategory();
    sub_category_id=ParseJSON.sub_id;
    sub_cate_name=ParseJSON.sub_name;
    displaySubCategory();

here is how i am showing items on listView: private void displaySubCategory() {

    //Array list of categories
    ArrayList<SubCategory> CategoryList = new ArrayList<SubCategory>();
    //sub_category_id=temp_id;
    //sub_cate_name=temp_name;
    for(int i=0;i<sub_cate_name.length;i++) {
        SubCategory Category = new SubCategory(sub_cate_name[i], sub_category_id[i], false);
        CategoryList.add(Category);

    }

    //create an ArrayAdaptar from the String Array
    subCategory = new SubCategoryAdapter(this,R.layout.sub_category_items, CategoryList);
    ListView listView = (ListView) findViewById(R.id.sub_category_list);
    // Assign adapter to ListView
    listView.setAdapter(subCategory);


    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,
                                int position, long id) {
            // When clicked, show a toast with the TextView text
            Category Category = (Category) parent.getItemAtPosition(position);
            Toast.makeText(getApplicationContext(),
                    "Clicked on Row: " + Category.getName(),
                    Toast.LENGTH_LONG).show();
        }
    });

}

Here is my Adapter Class private class SubCategoryAdapter extends ArrayAdapter {

    private ArrayList<SubCategory> CategoryList;
    private String[] ids;

    public SubCategoryAdapter(Context context, int textViewResourceId,ArrayList<SubCategory> CategoryList) {
        super(context, textViewResourceId, CategoryList);
        this.CategoryList = new ArrayList<SubCategory>();
        this.CategoryList.addAll(CategoryList);
        // ids=id;
    }

    private class ViewHolder {
        TextView code;
        CheckBox name;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        ViewHolder holder = null;
        //Log.v("ConvertView", String.valueOf(position));

        if (convertView == null) {
            LayoutInflater vi = (LayoutInflater)getSystemService(
                    Context.LAYOUT_INFLATER_SERVICE);
            convertView = vi.inflate(R.layout.sub_category_items, null);

            holder = new ViewHolder();
            holder.code = (TextView) convertView.findViewById(R.id.sub_list_text);
            holder.name = (CheckBox) convertView.findViewById(R.id.sub_category_checkbox);
            convertView.setTag(holder);

            holder.name.setOnClickListener( new View.OnClickListener() {
                public void onClick(View v) {
                    CheckBox cb = (CheckBox) v ;
                    SubCategory Category = (SubCategory) cb.getTag();
                   /* Toast.makeText(getApplicationContext(),
                            "Clicked on Checkbox: " + cb.getText() +
                                    " is " + cb.isChecked()Toast.LENGTH_LONG).show();*/
                    Category.setSelected(cb.isChecked());
                }
            });
        }
        else {
            holder = (ViewHolder) convertView.getTag();
        }

        SubCategory Category = CategoryList.get(position);
        holder.code.setText(""+Category.getCode()+"");

        holder.name.setText(Category.getName());
        holder.name.setChecked(Category.isSelected());
        holder.name.setTag(Category);

        return convertView;

    }

}




Save new workbook from selected sheets

So my main goal is to save sheets (depending on if they are selected by a checkbox on the front page) to a new workbook.

I have 6 sheets, so I have 6 different checkboxes on my front page/sheet.

Here is my example code I've tried (Note: this only shows a check for 1 checkbox, however I require this for 6 checkboxes):

Sub saveSheetWorkbook()

Dim exampleName As Variant
Dim exampleSavePath As String
Dim exampleSheet As Variant

exampleName = InputBox("Who will this be sent to?")

exampleSavePath = ActiveWorkbook.Path & "\" & exampleName

If Worksheets("Example Worksheet 1").Range("E29") = True Then
exampleSheet = "Example Worksheet 2"
End If

Sheets(Array("Example Worksheet 1"), exampleSheet).Copy
ActiveWorkbook.SaveAs Filename:=exampleSavePath, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

End Sub

For example, I want to always save Example Worksheet 1, but only save Example Worksheet 2 (and 3,4,5,6) if the checkbox is ticked. The cell E29 in Example Worksheet 1 is the linked cell for the checkbox.

So this macro works when the checkbox is ticked, but when the checkbox is unticked, I get an error.

I have set it up so that the sheet array either contains the name or nothing. but when containing nothing, that gives me the error.

Any help would be great.




Get ID of checkbox inside of listview item in OnItemClick listener

I got a listview with items. Each item has a chekbox. Now if a item is clicked, I want to change the state of this checkbox. How can I get the ID of the checkbox when the listview item is clicked?

I got this code:

cList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapter, View v, int position, long arg3) {
                Client currentClient = (Client) mAdapter.getItem(position);

            }
        });




PHP checkbox with 2 correct answer

I'm doing a quiz the below is a html checkbox.

<p>3. The J2EE components includes:</p>
            <p><label for="JavaDevelopmentKit">
               <input type="checkbox" id="JavaDevelopmentKit" name="category[]" value="JavaDevelopmentKit"/>Java Development Kit</label></p>
            <p><label for="VisualStudio">
               <input type="checkbox" id="VisualStudio" name="category[]" value="VisualStudio"/>Uses Visual Studio</label></p>
            <p><label for="WriteOnce">
               <input type="checkbox" id="WriteOnce" name="category[]" value="WriteOnce"/>Write Once Run Anywhere technology</label></p>

this is my php code

 if ($q3 == ""){
            $errMsg = "<p>You must answer question 3.</p>";
        }
        else if (isset($_POST['JavaDevelopmentKit']) && isset($_POST['WriteOnce'])
                $total++;
            }

My PHP for checkbox is not working.

Even if I change it to

 if ($q3 == ""){
                    $errMsg = "<p>You must answer question 3.</p>";
                }
                else if (isset($_POST['JavaDevelopmentKit'])
                        $total++;
                    }

Total is not increment by 1.




python script to submit webpage checkbox request

I want to a script to click the checkbox on a webpage. The checkbox source code looks like below:

<input type='checkbox' id='checkMe' name='checkMe' onclick='javascript:submitHome();'/><label for='checkMe'>Click here&nbsp;&nbsp;&nbsp;&nbsp;<a href="/goes/LogOutAction.do">Cancel</a>

Any suggestions?




checkboxes postback on gridview

I put a checkbox in gridview inside of itemtemplate with autopostback=true. My gridview was binded with sp. Every click on the checkbox save the id of my row in a arraylist in the event Checkbox_CheckedChanged. My problem this event id fired for every row in my gridview. Only I need is that event occur only once. this is my code.

<asp:UpdatePanel ID="upGrillaPadre" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:GridView ID="grvResultado" runat="server" CssClass="table table-condensed table-datatable grilla" GridLines="None" DataKeyNames="Id" AutoGenerateColumns="False" OnRowCommand="grvResultado_RowCommand1" data-pdf="true" data-imprimir="true">
            <Columns>
                <asp:TemplateField>
                   <HeaderTemplate>
                       <input id="chkHeader" type="checkbox" runat="server" onclick="grilla_checked_all(this);" />
                   </HeaderTemplate>
                   <ItemTemplate>
                       <asp:CheckBox ID="chkRows" runat="server" onclick="grilla_checked(this);" OnCheckedChanged="chkRows_CheckedChanged" AutoPostBack="true" />
                   </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Id" HeaderText="Secuestro Nº"></asp:BoundField>
                <asp:BoundField DataField="NroSumario" HeaderText="Sumario Nº"></asp:BoundField>
                <asp:BoundField DataField="ApellidoNombre" HeaderText="Apellido y Nombre"></asp:BoundField>
                <asp:BoundField DataField="NroCaja" HeaderText="Nº Caja"></asp:BoundField>
                <asp:BoundField DataField="Fechaingreso" HeaderText="Fecha ingreso"></asp:BoundField>
                <asp:BoundField DataField="FechaSecuestro" HeaderText="Fecha Secuestro"></asp:BoundField>
                <asp:BoundField DataField="Autos" HeaderText="Autos"></asp:BoundField>
                <asp:BoundField DataField="Cooperacion" HeaderText="Nº Coop."></asp:BoundField>
                <asp:BoundField DataField="ElementosSecuestrados" HeaderText="Elem. Secuestrados"></asp:BoundField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="grvEliminar" runat="server" CssClass="btn btn-info btn-sm fa fa-eraser" CommandName="eliminar" CommandArgument='<%#Container.DataItemIndex %>'></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
             </Columns>
        </asp:GridView>
        </div>
    </ContentTemplate>
 </asp:UpdatePanel>

//CodeBehind

 protected void chkRows_CheckedChanged(object sender, EventArgs e)
    {
        ArrayList arr = new ArrayList();

        if (Session["seleccionados"] == null)
        {

            Session.Add("selecconados", arr);

        }
        else
        {
            if (Session["seleccionados"] != "")
            { 
            arr = (ArrayList)Session["seleccionados"];
                 }
        }

        CheckBox cbk = (CheckBox)sender;
        GridViewRow row = (GridViewRow)((CheckBox)sender).Parent.Parent;
        bool but = cbk.Checked ? true : false;

        if (but)
        {

            arr.Add(grvResultado.Rows[row.RowIndex].Cells[1].Text);

        }
        else
        {
            int valor = 0;
            for (int i = 0; i < arr.Count; i++)
            {
                valor = i;
                if(arr[i].ToString()  == grvResultado.Rows[row.RowIndex].Cells[1].Text)
            {
                arr.RemoveAt(valor);
            }


            }

        }

        Session["seleccionados"] = arr;

        upGrillaPadre.Update();



    }




Jquery ajax filter checkbox

I making a country/department/city filter with checkboxes and ajax calls.

enter image description here

When i select a country Argentina for example all the departments and cities are selected and when i select a department all cities inside that department are selected. This is working fine but when i clic Argentina it calls again the ifChanged tigger for all departments and cities.

$('input').on('ifChanged', function(event){
   // Ajax call
});

So when the event is tiggered the ajax call is executed lot of times because is tiggered again and again until it finished.

I need to call the ajax function when the last element in trigger is complete, is this possible? Thanks




Can't get checkbox to update on refresh

I have a form with a checkbox. When saved to the db it has 2 possible states: if checked it is "on" otherwise the field is empty. A similar form is presented for editing a row from the db. It allows the user to make changes and then review them before submitting an update to the db. At the moment, all other fields (text and radio sets) reflect the changes when the page is refreshed through a submit button. However, the checkbox doesn't retain the update to checked or unchecked.

my code:

<td><input type='checkbox' name = 'reg' id = 'reg' value =  
'".$_POST['reg']."' ".($_POST['reg'] == 'on' ? 
'checked="checked"' : '')."/></td>

I can show more code if it helps - I thought this was the portion that needed repair.




php page that opens based on checkboxes checked

I have created a dropdown menu with 5 options. There are 6 checkboxes too on the same page along with a NEXT button(input type). The first option of dropdown on being clicked enables first three checkboxes and the second option enables last three (disabling first three) checkboxes. Now I want to open up different php pages for different dropdown options. Let me summarize up like i chose option 1 from dropdown menu and then check option 3 from checkboxes and the when i click on next only page targeted to option 1 from dropdown menu should get open. and there are 5 different pages for 5 options from dropdown. So it should be linked with dropdown and checked box that was checked should go into the database.

here is the code

    <select id="Objective" form="theForm" name="category" >
            <option value="0" selected="1">Choose from dropdown</option>
        <option value="bet">beta</option>
        <option value="theth">thetha</option>
        <option value="p">pi</option>
        <option value="ps">psi </option>
        <option value="alph">alpha</option>
    </select>

<input type="checkbox" class="dissable" onclick="check();" value="1" /> Laptops
<input type="checkbox" class="dissable" onclick="check();" value="1" /> Computers 
<input type="checkbox" class="dissable" onclick="check();" value="2" /> Art 
<input type="checkbox" class="dissable" onclick="check();" value="1" /> Computers Peri
<input type="checkbox" class="dissable" onclick="check();" value="1" /> Movies
<input type="checkbox" class="dissable" onclick="check();" value="2"/> Beauty 

<script>
$("#Objective").on("change", function () {
    $(".dissable[value='1']").prop("disabled", false);
    $(".dissable[value='2']").prop("disabled", false);
    if ($(this).val() == "theth") {
        $(".dissable[value='1']").prop("disabled", true);
    } else if ($(this).val() == "bet") {
        $(".dissable[value='2']").prop("disabled", true);
    } else {
        $(".dissable[value='1']").prop("disabled", true);
        $(".dissable[value='2']").prop("disabled", true);

    }
}).trigger('change');

<input type='submit' name='submit' value='Next' align='right'/>

I think I have made my ques clear and if still doubt persists please ask..




CheckBox Jquery - Prompt Not Working

I had this working previously but for some reason it has stopped working, a syntax error I presume. Can anyone spot the issue?

I have had it running with the html inserted into the source on a browser and Jquery in a console. But not in JSFiddle and a few other options.

It should prompt when ticked and prompt again if unticked:

<td class="icon">
            <input type="checkbox" id="my_checkbox">
    </td>


    $("#my_checkbox").click(function() {
      if (this.checked) {
        this.checked = confirm('Are you sure you want to CONFIRM the order and EMAIL THE CUSTOMER?'); 
      }    
      else {
        this.checked = !confirm('Do you really want to change this to NOT RECEIVED?'); 
      }  
    });

http://ift.tt/2eJckEq




check box state not working properly

using List view with check box. after click on check box and doing scroll, check box state is not working properly.

i tried check box in listview not working properly
but it is not working for me.

here is my Adapter code:

  private class CustomerEventsAdapter extends BaseAdapter {
            private Context myContext;
            private ArrayList<Events> myEventArrayList;

            private LayoutInflater mInflater;
            private Boolean isSelected = false;

            public EventsAdapter(Context ctx, ArrayList<Events> theArrayListEvents) {
                this.myContext = ctx;
                this.myEventArrayList = theArrayListEvents;
                mInflater = LayoutInflater.from(ctx);

            }

            @Override
            public int getCount() {
                return myEventArrayList.size();
            }

            @Override
            public Object getItem(int i) {
                return myEventArrayList.get(i);
            }

            @Override
            public long getItemId(int i) {
                return i;
            }

            @Override
            public View getView(final int i, View convertView, ViewGroup viewGroup) {
                View view = convertView;
                if (view == null) {
                    view = mInflater.inflate(R.layout.event_item_list, null);
                    final ViewHolder holder = new ViewHolder();


                    holder.myCheckBoxCustomerEventItem = (CheckBox) view.findViewById(R.id.checkBoxCustomerEventItem);





                    holder.myCheckBoxCustomerEventItem.setOnClickListener(new View.OnClickListener() {

                        @Override
                        public void onClick(View v) {
                            Events events = myEventArrayList.get(i);
                            //is chkIos checked?
                            if (((CheckBox) v).isChecked()) {
                                holder.myCheckBoxCustomerEventItem.setChecked(true);
                                eventsInfo.setMyIsSelected(true);
                            } else {
                                holder.myCheckBoxCustomerEventItem.setChecked(false);
                                eventsInfo.setMyIsSelected(false);
                            }
                            //case 2

                        }
                    });




                    view.setTag(holder);

                }

                if (view != null) {
                    ViewHolder holder = (ViewHolder) view.getTag();
                    Events eventsInfo = myEventArrayList.get(i);

                    boolean isChecked = eventsInfo.getMyIsSelected();


                    if (isChecked) {
                        holder.myCheckBoxCustomerEventItem.setChecked(true);


                    } else {
                        holder.myCheckBoxCustomerEventItem.setChecked(false);


                    }
                }

                return view;
            }
        }




how to get checkbox value as checked from database in php?

in database values are stored as "A,B,C,D,E,F" etc. now i have to fetch those data in the form for update. i have to check the checkbox if it matches the value with database value.

$rs=sql("select sectionName from sections where sectionName != ' ' order by     sectionName");
$cat_options="";
    foreach($rs as $d){
        $option=$d['sectionName'];
        $cat_options.= "<label><input type='checkbox' name='category[]' value='$option'>$option</label><br/>";
    }

It retrieve list of category from one table.

$a = explode(",", $category);

$a is array of name of category that should be checked in list of category.

I already knew that there are lots off topics on net related to my topics. I tried them but no luck.




Checkbox highlight not working when its checked

i have included some checkboxes within my html page so the user can check and uncheck them, i also wrote the style to highlight the checkbox borders and also the label but still nothing work.

can do with a bit of help.

 <input type="checkbox" name="createartwork" id="createartwork"> 
 <label class="label-for-check" for="createartwork">I want you  to create my artwork</label> 


input[type=checkbox]:checked  + label::after{

background-color: #FD6418;

}

input:checked {
height: 50px;
width: 50px;

}




Selecting a checkbox and using button to check selected checkbox

So I have this loop and below it is a button,

Html

       

        <div class="large-3 columns">
            <button>Initiate</button>
        </div>   

and within the loop is a checkbox, so there will be 10 rows and columns of checkboxes.

Below is a script preventing the checkbox to be checked when clicked

Js

$('input[type="checkbox"]').on('click', function(event) {
event.preventDefault();
event.stopPropagation();

return false;

});

The questions are how do I make a clicked checkbox "selected" and how do I check the "selected" checkbox using a button?

Thank you in advance :)




how to get value of default checked checkbox in alert dialog android java

final List < CharSequence > checkedsurveylist = new ArrayList < CharSequence > ();
final JSONArray jsonArray = new JSONArray(response);
final boolean[] checkedItems = new boolean[jsonArray.length()];
for (int i = 0; i < jsonArray.length(); i++) {
  JSONObject obj = (JSONObject) jsonArray.get(i);
  String syncstatus = "";
  if (obj.get("syncstatus").toString().matches("1")) {
    syncstatus = "Not yet synchronized";
    checkedItems[i] = false;
  } else if (obj.get("syncstatus").toString().matches("2")) {
    syncstatus = "Synchronized";
    checkedItems[i] = true;
  }
  checkedsurveylist.add("(" + obj.get("sysid").toString() + ")" + obj.get("surveytitle").toString() + " - " + syncstatus);
}


System.out.println("checkedItems " + checkedItems);
final List < String > mSelectedItems = new ArrayList < String > ();
final List < Integer > mSelectedItemsindex = new ArrayList < Integer > ();
AlertDialog.Builder builder = new AlertDialog.Builder(Connect_server.this);
builder.setTitle("Survey List")
  .setMultiChoiceItems(checkedsurveylist.toArray(new CharSequence[checkedsurveylist.size()]), checkedItems,
    new DialogInterface.OnMultiChoiceClickListener() {


      @Override
      public void onClick(DialogInterface dialog,
        int which, boolean isChecked) {

        checkedsurveylist.toArray()[which] = isChecked;
        // Get the current focused item
        String currentItem = checkedsurveylist.get(which).toString();

        // Notify the current action
        Toast.makeText(getApplicationContext(),
          currentItem + " " + isChecked, Toast.LENGTH_SHORT).show();
        if (isChecked) {

          mSelectedItems.add(checkedsurveylist.get(which).toString());
          mSelectedItemsindex.add(which);
        } else if (mSelectedItems.contains(which)) {
          mSelectedItemsindex.remove(Integer.valueOf(which));

          mSelectedItems.remove(Integer
            .valueOf(which));
        }
      }
    });
// Set the positive/yes button click listener
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                          
  @Override
  public void onClick(DialogInterface dialog, int which) {
    // Do something when click positive button
    System.out.println("asdasdasd " + mSelectedItemsindex.size());
    for (int i = 0; i < mSelectedItemsindex.size(); i++) {
      System.out.println("asdasdasd " + checkedsurveylist.get(i).toString());
    }

  }
});

This is my code for making a list with checkbox in alert dialog box. It can have multiple selection. my problem is I can get the value of default checked checkbox. I can only get the value if the checkbox is manually check by the user.

How to get the value of checkbox if it is by default checked.




How to get a modal when a checkbox is selected?

Here are my codes

ex1.php

<body>

<form>

  <label>
    <input type="checkbox" value="LH" name="name">LH</label>
  <label>
    <input type="checkbox" value="LJ" name="name">LJ</label>
  <label>
    <input type="checkbox" value="LL" name="name">LL</label>
  <label>
    <input type="checkbox" value="FA" name="name">FA</label>
  <label>
    <input type="checkbox" value="FB" name="name">FB</label>
  <label>
    <input type="checkbox" value="FU" name="name">FU</label>
</form>

<!--modal-->
<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Modal Header</h4>
      </div>
      <div class="modal-body">
        <?php

        $test = $_POST['test'];

        $servername = "localhost";
        $username = "root";
        $password = "";


// Create connection
        $conn = mysqli_connect($servername, $username, $password);


// Check connection
        if (!$conn) {
        die("Connection failed: " . mysqli_connect_error());
        }
        echo "Connected successfully";

        mysqli_connect_db("db",$conn);

        $sql = "SELECT Subcat FROM subcat where CatId=".$test." ";
        $res = mysqli_query($conn,$sql);
        while($row = mysqli_fetch_assoc($res)){
        echo "<input type='checkbox' name='category[]' value='".$row['Subcat']."'>"
        .$row['Subcat'];
        echo "<br>";   
}
        ?>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>


</body>

ex1.js

$document.ready(function(){
    $(":checkbox").click(function(){
        var value_ck = $(this).val();
        $.ajax(
            url:"ex1.php";
            type:"post";
            data:{test:value_ck};
            success:function(){
                $("#myModal").modal();




                });
    });
});

What I want to do here is as follows

I have a checkbox list in the form. When I click a checkbox ,a modal should appear with corresponding data coming from the database.I am a very beginner to Jquery. My codes are not working.I Found solutions everywhere to fix that. but I was unable .

Could anyone please to help me?




mercredi 26 octobre 2016

jquery checkbox logic does not works

I am working on validation logic which is working fine but problem comes. when i click on checkbox as checked then the logic written for it works correctly but when i uncheck checkbox then also logic for checked gets applied . i also tried to shuffle or tried to written logic of checked and unchecked at top or bottom and vice versa, still it tries to break the logic of each other.

here is jquery code

function saveEventForEditOrCreate() {

        $('.custom_error_msg').remove();
        var eventName=$('#eventName').val().trim();
        if(eventNames.indexOf(eventName)>-1){
            validationError("eventName", "This is an invalid event name.  Please update the name and try again.");
            return true;
        }

        var startDate = $('#startDate').val();
        var endDate = $('#endDate').val();
        var startTime=$('#startTime').val();
        var endTime=$('#endTime').val();

        // if allDayEvent is checked and all fields are empty
        if($( "#allDayEvent" ).prop( "checked", true ) && $('#eventName').val()==="" && isDate(startDate) === false && isDate(endDate) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("endDate", "Make have end date");
            return true;
        }
        // if alldayevent is checked and event name start date is empty
        else if($( "#allDayEvent" ).prop( "checked", true ) && $('#eventName').val()==="" && isDate(startDate) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            return true;
        }

        // if alldayevent is checked and event name start date is empty
        else if($( "#allDayEvent" ).prop( "checked", true ) && $('#eventName').val()==="" && isDate(endDate) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("endDate", "Must have end date");
            return true;
        }
        // if alldayevent is checked and event name is empty 
        else if($( "#allDayEvent" ).prop( "checked", true ) && $('#eventName').val()==="")
        {
            validationError("eventName", "Must have event name");
            return true;
        }
        // if alldayevent is checked and event name is present and start date is empty
        else if($( "#allDayEvent" ).prop( "checked", true ) && isDate(startDate) === false)
        {
            validationError("startDate", "Must have end date");
            return true;
        }
        else
        {
            // if alldayevent is checked and event name is present and end date is empty
            if($( "#allDayEvent" ).prop( "checked", true ) && isDate(endDate) === false)
        {
            validationError("endDate", "Must have end date");
            return true;
        }

        } //else ends


        // if event name and all felds are blank
         if($('#eventName').val()==="" && isDate(startDate) === false && validateHHMM($("#startTime").val()) === false && isDate(endDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }   
        //if event name and  all are empty , only start date is filed 
        else if($('#eventName').val()===""  && validateHHMM($("#startTime").val()) === false && isDate(endDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date" );
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // if event name and  all are empty , only start time is filed 
        else if($('#eventName').val()===""  && isDate(startDate) === false && isDate(endDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("endDate", "Make have end date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // if event name and  all are empty , only end date is filed 
        else if($('#eventName').val()===""  && isDate(startDate) === false && validateHHMM($("#startTime").val()) === false  &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // if event name and  all are empty , only end time is filed 
        else if($('#eventName').val()==="" && isDate(startDate) === false && validateHHMM($("#startTime").val()) === false && isDate(endDate) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            return true;
        }
        // // if event name , start date , start time are empty
        else if($('#eventName').val()==="" && isDate(startDate) === false && validateHHMM($("#startTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // if event name , end date , end time are empty
        else if($('#eventName').val()==="" && isDate(endDate) === false && validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("endDate", "Must have start date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // if event name , start date , end date are empty 
        else if($('#eventName').val()==="" && isDate(startDate) === false && isDate(endDate) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("endDate", "Make have end date");
            return true;
        }
        // if event name , start time , end time are empty 
        else if($('#eventName').val()==="" && validateHHMM($("#startTime").val()) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }   

        //  if event name , start date , end time are blank
         else if($('#eventName').val()==="" && isDate(startDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // // if event name , start time , end date are blank
        if($('#eventName').val()==="" &&  validateHHMM($("#startTime").val()) === false && isDate(endDate) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            return true;
        }   

        // // // if event name is present and all fields are empty
        else if(isDate(startDate) === false && validateHHMM($("#startTime").val()) === false && isDate(endDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("startDate", "Must have start date");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }   


        // // // if event name , start date are present and all fields are blank
        else if(validateHHMM($("#startTime").val()) === false && isDate(endDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // //if event name and end date are present and all fields are blank
        else if(isDate(startDate) === false && validateHHMM($("#startTime").val()) === false &&  validateHHMM($("#endTime").val()) === false )
        {

            validationError("startDate", "Must have start date");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // // if event name , start time are present and all fields are blank
        else if(isDate(startDate) === false && isDate(endDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {
            validationError("startDate", "Must have start date");
            validationError("endDate", "Make have end date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // // if event name , end time are present and all fields are blank
        else if(isDate(startDate) === false && validateHHMM($("#startTime").val()) === false && isDate(endDate) === false)
        {
            validationError("startDate", "Must have start date");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            return true;
        }


        // //  // if event name , start date  blank
         else if($('#eventName').val()==="" && isDate(startDate) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("startDate", "Must have start date");
            return true;
        }

        // // // if event name , start time are blank
        else if($('#eventName').val()==="" &&  validateHHMM($("#startTime").val()) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        // // // if event name , end date are blank
        else if($('#eventName').val()==="" &&  isDate(endDate) === false)
        {
            validationError("eventName", "Must have event name");
            validationError("endDate", "Make have end date");
            return true;
        }

        // if event name , end time are blank
        else if($('#eventName').val()==="" && validateHHMM($("#endTime").val()) === false )
        {
            validationError("eventName", "Must have event name");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }

        // // if event name is present and start date , end date are blank
        else if(isDate(startDate) === false && isDate(endDate) === false )
        {

            validationError("startDate", "Must have start date");
            validationError("endDate", "Make have end date");
            return true;
        }

        // // if event name is present and start time , end time are blank
        else if( validateHHMM($("#startTime").val()) === false &&  validateHHMM($("#endTime").val()) === false )
        {

            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }

        //  event name is present and start date , end time are blank
        else if(isDate(startDate) === false && validateHHMM($("#endTime").val()) === false )
        {

            validationError("startDate", "Must have start time");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }


        //  event name is present and start time , end date are blank           
        else if(validateHHMM($("#startTime").val()) === false && isDate(endDate) === false )
        {

            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            return true;
        }


        else  //event name is filled and all are empty
        {
            if(isDate(startDate) === false && validateHHMM($("#startTime").val()) === false && isDate(endDate) === false &&  validateHHMM($("#endTime").val()) === false )
        {

            validationError("startDate", "Must have start time");
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            validationError("endDate", "Make have end date");
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        } //else ends  



        //any single fields are empty   
        if(isDate(startDate) === false) {
            validationError("startDate", "Must have start date");
            return true;
        }
        if(isDate(endDate) === false)   {
            validationError("endDate", "Make have end date");
            return true;
        }
        if(validateHHMM($("#startTime").val()) === false )  {
            validationError("startTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }
        if(validateHHMM($("#endTime").val()) === false )    {
            validationError("endTime", "Make sure time is in the HH:MM format.  Example: 08:00");
            return true;
        }





        if( $("#oldEventName").val() != "" ) {
            updateEvent();
        }
        else {
            createEvent();
        }           
    }

here is jsp page

                            </div>
                        </div>
                    </div>
                    <div class="acc events acc_enabled">
                        <div class="content">
                            <h3>Events <img src="${pageContext.request.contextPath}/img/ico_info.png" class="tt" title="Add any additional events to your regular schedule, such as Friday afternoon early closures in the summer. Or add events to create a holiday schedule, like a yearly closure on the first day of January." alt="" /></h3>
                            <div class="icontent" style="box-sizing: border-box; overflow: hidden;">
                                <br clear="all">
                                <div id="eventlist_wrapper">
                                    <table class="dtbl dtblsm eventlistTable" id="eventList_Table">
                                        <thead>
                                            <tr role="row">
                                                <th>Event Name</th>
                                                <th style="width:auto;text-align:right;">Edit</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                    <div class="addfields">
                                        <a href=""><img src="${pageContext.request.contextPath}/img/bttn_add.jpg" id="expandAddEvent"></a>
                                    </div>
                                </div>
                                <script type="text/javascript">
                                $('#eventList_Table').DataTable( {
                                "bFilter": false,
                                "bPaginate": false,
                                "bInfo" : false,
                                "aoColumnDefs": [
                                { 'bSortable': false, 'aTargets': [ 1 ] }
                                ]
                                });
                                </script>
                                <div class="addeditevent" style="display:none;">
                                <form action="" method="">
                                    <div class="left-add">
                                        <div class="fbox">
                                            <input name="oldEventName" id="oldEventName" type="hidden">
                                            <label for="eventName"><span></span>Event Name</label>                                              
                                            <input type="text" id="eventName" maxlength="40" value="">                                              
                                        </div>
                                        <br clear="all">
                                        <h3 style="margin:30px 0;display:block;clear:both;">Event time</h3>
                                        <div class="fbox timepicker">
                                            <label for="startDate"><span></span>Start Date</label>
                                            <input type="text" id="startDate" value="">
                                        </div>
                                        <div class="fbox timepicker">
                                            <label for="startTime"><span></span>Start Time</label>
                                            <input type="text" id="startTime" value=""  placeholder="Ex: 08:00">
                                        </div>
                                        <div class="fbox timepicker" style="width:250px !important;">
                                            <select name="startTime_ampm" id="startTime_ampm" class="select" style="margin-top: 41px;width:100px;">
                                                <option value="AM">AM</option>
                                                <option value="PM">PM</option>
                                            </select>
                                            <input id="allDayEvent" name="allDayEvent" type="checkbox" value="true">
                                            <label for="allDayEvent" style="float: right; margin: 35px 0 0 0;"><span></span>All Day Event</label>
                                        </div>
                                        <br clear="all">
                                        <div class="fbox timepicker">
                                            <label for="endDate"><span></span>End Date</label>
                                            <input type="text" id="endDate" value="">
                                        </div>
                                        <div class="fbox timepicker">
                                            <label for="endTime"><span></span>End Time</label>
                                            <input type="text" id="endTime" value="" placeholder="Ex: 08:00">
                                        </div>
                                        <div class="fbox timepicker" style="width:250px !important;">
                                            <select name="endTime_ampm" id="endTime_ampm" class="select" style="margin-top: 41px;width:100px;">
                                                <option value="AM">AM</option>
                                                <option value="PM">PM</option>
                                            </select>
                                        </div>
                                        <br clear="all">
                                        <h3 style="margin:30px 0;display:block;clear:both;">Recurrence Pattern <img src="${pageContext.request.contextPath}/img/ico_info.png" class="tt" title="Recurrence pattern is how often this event will occur." alt="" /></h3>
                                        <div class="fbox timepicker">
                                            <label for="recurrencePattern"><span></span>Recurs</label>
                                            <select name="recurrencePattern" id="recurrencePattern" class="select">
                                                <option value="NEVER">Never</option>
                                                <option value="DAILY">Daily</option>
                                                <option value="WEEKLY">Weekly</option>
                                                <option value="MONTHLY">Monthly</option>
                                                <option value="YEARLY">Yearly</option>
                                            </select>
                                        </div>
                                        <br clear="all">
                                        <div class="fbox never" style="width:100%;"></div>
                                        <div class="fbox daily" style="width:100%;display:none;">
                                            <label for="everyDay" style="display: inline-block; color: #000;"><span></span>Every</label>
                                            <input type="text" id="everyDay" value="" style="width: 40px; margin: 0 10px 0 0;">
                                            day(s) <input id="daily_sun" name="daily_sun" type="checkbox" value="true">
                                        </div>
                                        <div class="fbox weekly" style="width:100%;display:none;">
                                            <label for="everyDate" style="display: inline-block; color: #000;"><span></span>Every</label>
                                            <input type="text" id="everyDate" value="" style="width: 40px; margin: 0 10px 0 0;">
                                            week(s) on: <input id="weekly_sun" name="weekly_sun" type="checkbox" value="true">
                                            <label for="weekly_sun" style="display:inline-block; width:auto;padding:14px 10px 6px !important"><span></span>Sunday</label>
                                            <input id="weekly_mon" name="weekly_mon" type="checkbox" value="true">
                                            <label for="weekly_mon" style="display:inline-block; width:auto;"><span></span>Monday</label>
                                            <input id="weekly_tues" name="weekly_tues" type="checkbox" value="true">
                                            <label for="weekly_tues" style="display:inline-block; width:auto;"><span></span>Tuesday</label>
                                            <input id="weekly_wed" name="weekly_wed" type="checkbox" value="true">
                                            <label for="weekly_wed" style="display:inline-block; width:auto;"><span></span>Wednesday</label>
                                            <input id="weekly_thurs" name="weekly_thurs" type="checkbox" value="true">
                                            <label for="weekly_thurs" style="  display: inline-block; width: auto; margin: 0 0 0 215px;"><span></span>Thursday</label>
                                            <input id="weekly_fri" name="weekly_fri" type="checkbox" value="true">
                                            <label for="weekly_fri" style="display:inline-block; width:auto;"><span></span>Friday</label>
                                            <input id="weekly_sat" name="weekly_sat" type="checkbox" value="true">
                                            <label for="weekly_sat" style="display:inline-block; width:auto;"><span></span>Saturday</label>
                                            <br clear="all">
                                        </div>
                                        <div class="fbox monthly" style="width:100%; display:none;">
                                            <label for="everyMonths" style="display: inline-block; color: #000;"><span></span>Every</label>
                                            <input type="text" id="everyMonths" value="" style="width: 40px; margin: 0 10px 0 0;">
                                            month(s) on: <input id="monthly_sun" name="monthly_sun" type="checkbox" value="true">
                                            <input type="radio" id="monthDay" name="monthlySelect" value="TYPE1">
                                            <label for="monthDay" style="  display: inline-block;padding: 20px 0 0 0!important;margin:0 0 0 30px;width: auto;"><span></span>Day <input type="text" id="monthly_dayOfMonth" value="" style="display:inline-block;width:30px;margin:0 10px;"> of the month</label>
                                            <input type="radio" id="dayPattern" name="monthlySelect" value="TYPE2">
                                            <label for="dayPattern" style="  display: inline-block; margin: 0 0 10px 30px;"><span></span>
                                            The
                                            <select name="monthlyrepeat01" id="monthlyrepeat01" class="select" style="width:80px;">
                                                <option value="FIRST">First</option>
                                                <option value="SECOND">Second</option>
                                                <option value="THIRD">Third</option>
                                                <option value="FOURTH">Fourth</option>
                                                <option value="LAST">Last</option>
                                            </select>
                                            <select name="monthlyrepeat02" id="monthlyrepeat02" class="select" style="width:110px;">
                                                <option value="SUNDAY">Sunday</option>
                                                <option value="MONDAY">Monday</option>
                                                <option value="TUESDAY">Tuesday</option>
                                                <option value="WEDNESDAY">Wednesday</option>
                                                <option value="THURSDAY">Thursday</option>
                                                <option value="FRIDAY">Friday</option>
                                                <option value="SATURDAY">Saturday</option>
                                            </select>
                                            of the month
                                        </label>
                                    </div>
                                    <div class="fbox yearly" style="width:100%; display:none;">                                             
                                            <label for="everyYear" style="display: inline-block; color: #000;"><span></span>Every</label>
                                            <input type="text" id="everyYear" value="" style="width: 40px; margin: 0 10px 0 0;">
                                            year(s) on: <input id="yearly_sun" name="yearly_sun" type="checkbox" value="true">
                                        <input type="radio" id="yearDay" name="yearlySelect" value="TYPE1">
                                        <label for="yearDay" style="  display: inline-block;padding: 20px 0 0 0!important;margin: 0 0 0 30px;width: auto;"><span></span>Day <input type="text" id="yearly_dayOfMonth" value="" style="display:inline-block;width:30px;margin:0 10px;"> of 
                                        <select name="yearly_DayOfMonthMonth" id="yearly_DayOfMonthMonth" class="select" style="width:110px;">
                                            <option value="JANUARY">January</option>
                                            <option value="FEBRUARY">February</option>
                                            <option value="MARCH">March</option>
                                            <option value="APRIL">April</option>
                                            <option value="MAY">May</option>
                                            <option value="JUNE">June</option>
                                            <option value="JULY">July</option>
                                            <option value="AUGUST">August</option>
                                            <option value="SEPTEMBER">September</option>
                                            <option value="OCTOBER">October</option>
                                            <option value="NOVEMBER">November</option>
                                            <option value="DECEMBER">December</option>
                                        </select></label>
                                        <input type="radio"function id="yearDayPattern" name="yearlySelect" value="TYPE2">
                                        <label for="yearDayPattern" style="  display: inline-block; margin: 0 0 10px 30px;"><span></span>
                                        The
                                        <select name="yearlyrepeat01" id="yearlyrepeat01" class="select" style="width:80px;">
                                            <option value="FIRST">First</option>
                                            <option value="SECOND">Second</option>
                                            <option value="THIRD">Third</option>
                                            <option value="FOURTH">Fourth</option>
                                            <option value="LAST">Last</option>
                                        </select>
                                        <select name="yearlyrepeat02" id="yearlyrepeat02" class="select" style="width:110px;">
                                            <option value="SUNDAY">Sunday</option>
                                            <option value="MONDAY">Monday</option>
                                            <option value="TUESDAY">Tuesday</option>
                                            <option value="WEDNESDAY">Wednesday</option>
                                            <option value="THURSDAY">Thursday</option>
                                            <option value="FRIDAY">Friday</option>
                                            <option value="SATURDAY">Saturday</option>
                                        </select>
                                        of
                                        <select name="yearlyrepeat03" id="yearlyrepeat03" class="select" style="width:110px;">
                                            <option value="JANUARY">January</option>
                                            <option value="FEBRUARY">February</option>
                                            <option value="MARCH">March</option>
                                            <option value="APRIL">April</option>
                                            <option value="MAY">May</option>
                                            <option value="JUNE">June</option>
                                            <option value="JULY">July</option>
                                            <option value="AUGUST">August</option>
                                            <option value="SEPTEMBER">September</option>
                                            <option value="OCTOBER">October</option>
                                            <option value="NOVEMBER">November</option>
                                            <option value="DECEMBER">December</option>
                                        </select>
                                    </label>
                                </div>
                                <br clear="all">
                                <div class="recurrenceRange" style="display:none;">
                                    <h3 style="margin:30px 0;display:block;clear:both;">Recurrence Range <img src="${pageContext.request.contextPath}/img/ico_info.png" class="tt" title="Recurrence range is when this series of events will end. The start date for recurrence range is always the same as the Event time - Start date you selected above." alt="" /></h3>
                                    <div class="fbox" style="width:100%;font-size:14px;">
                                        <div>
                                            <span style="  display: inline-block;
                                                vertical-align: top;
                                            padding: 20px 10px 0 0;">End</span>
                                            <div style="display:inline-block; vertical-align:top;width:500px;">
                                                <input type="radio" id="never" name="userSelect" value="NEVER" checked="checked">
                                                <label for="never" style="padding: 20px 0 0 0!important; margin: 0;"><span></span>Never</label>
                                                <input type="radio" id="afterDate" name="userSelect" value="AFTER">
                                                <label for="afterDate" style="display:block; margin:0 0 10px 0;"><span></span>After
                                                <input type="text" id="afterDate_field" value="" style="display:inline-block;width:100px;margin:0 10px;">
                                            occurrences.</label>
                                            <input type="radio" id="calendarDate" name="userSelect" value="DATE">
                                            <label for="calendarDate" style="display:block; margin:10px 0;"><span></span>End
                                            <input type="text" id="endDate_picker" value="" style="display:inline-block;width:120px;margin:0 10px;">
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="bttns">
                        <input type="button" id="bttn_save" class="bttn save" value="Save" onclick="saveEventForEditOrCreate()"/>
                    </div>
                </div>
            </form>
            </div>
        </div>
    </div>
    <div class="bttns">
        <input type="button" id="bttn_trash" class="bttn trash" value="Delete" onclick="tryAndDeleteSchedule()">
        <input type="button" id="bttn_cancel" class="bttn cancel" value="Cancel" onclick="cancelAndFetchScheduleList()"/>
    </div>
    </div>
    </div>
    </div>
    <div class="toggle_pages toggle_page_hide" id="help_page">
    <h2>Help section</h2>
    <p>coming soon...</p>
    </div>
    </div>