logo
down
shadow

can't get correct checkbox value


can't get correct checkbox value

By : user2954269
Date : November 22 2020, 01:01 AM
To fix this issue My check box in my jsp is defined as: , This seems to be working for me
code :
<input  type="checkbox" onclick="isChkChecked(this);"/>

        function isChkChecked(elm) {
        console.log($(elm).is(':checked'));
        }


Share : facebook icon twitter icon
Correct way to do HTML5 checkbox

Correct way to do HTML5 checkbox


By : Durangow
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further As far as I know and the docs state, nothing fundamental has changed. The basic markup is
code :
<input name="your_name" value="your_value" type="checkbox">
WPF Checkbox content not correct

WPF Checkbox content not correct


By : Koen Notebaert
Date : March 29 2020, 07:55 AM
I wish this helpful for you You could use TextBlock as CheckBox.Content, instead of binding it directly, and bind its Text property
code :
<CheckBox IsChecked="{Binding IsChecked}" Width="149" MinWidth="149">
   <CheckBox.Content>
      <TextBlock Text="{Binding Item}"/>
   </CheckBox.Content>
</CheckBox>
Mark correct checkbox and UPDATE correct row in mysql

Mark correct checkbox and UPDATE correct row in mysql


By : PaulS
Date : March 29 2020, 07:55 AM
To fix this issue It's a tad confusing / convoluted but perhaps this might be more inline with what you are trying ( I think ) to accomplish. The generated forms need some way to refer to the record which they are to update - in this case the order_id would appear to be the correct choice. To that end a hidden field with the order_id value will be submitted with the form ( still unclear what done is supposed to do other than supply a value of "done" )
code :
function display_orders(){
        $query = query( "SELECT * FROM orders ORDER BY order_id DESC");
        confirm($query);

        while($row = fetch_array($query)) {

            $order_id = $row['order_id'];
            $order_amount = $row['order_amount'];
            $order_transaction = $row['order_transaction'];
            $order_status = $row['order_status'];
            $order_currency = $row['order_currency'];
            $order_date = $row['order_date'];
            $order_date = strtotime($order_date);
            $order_date = date('d-m-Y', $order_date);

            $checked = $row['mark_as_done'];


            if( $checked === "done" ){
                $checked_status = "checked";
            }else{
                $checked_status = "";
            }

        $orders = <<<DELIMITER
        <tr>
            <td><a href="index.php?order_details&id={$order_id}">{$order_id}</a></td>
            <td>{$order_transaction}</td>
            <td>{$order_amount}</td>
            <td>{$order_currency}</td>
            <td>{$order_status}</td>
            <td>{$order_date}</td>
            <td><a class="btn btn-danger" href="index.php?delete_order_id={$order_id}"><span class="glyphicon glyphicon-remove"></span></a></td>
            <td>

              <form action='index.php?orders' method='post'>
                  <input type='checkbox' name='done' value='done' {$checked_status} />
                  <input type='hidden' name='order_id' value='{$order_id}' />
                  <input class='btn btn-primary btn-sm' type='submit' name='submit' value='submit'>
              </form>
            </td>
        </tr>

        DELIMITER;
        echo $orders;
    }




    if( isset( $_POST['submit'], $_POST['order_id'], $_POST['done'] ) ){

        global $connection;

        $id = $_POST['order_id'];
        $value = $_POST['done'];

        $update_query = "UPDATE orders SET mark_as_done=? WHERE order_id =?;";

        $stmt = mysqli_stmt_init($connection);

        if( !mysqli_stmt_prepare($stmt, $update_query)){
            echo "SQL failed";
        } else {
            mysqli_stmt_bind_param( $stmt, "ss", $value, $id );
            mysqli_stmt_execute($stmt);
        }
    }
}
Double quotes in html non-literals? Which is the correct one: type="checkbox" or type=checkbox?

Double quotes in html non-literals? Which is the correct one: type="checkbox" or type=checkbox?


By : benhassen ahmed
Date : March 29 2020, 07:55 AM
wish help you to fix your issue When using attributes, you must remember the rules of XML, as well as the rules of general attribute use.
These are as follows:
Checkbox isn't checking to the correct value

Checkbox isn't checking to the correct value


By : progmeet
Date : March 29 2020, 07:55 AM
will help you Because localStorage stores the value as string, so when you have false, it is really stored as 'false' which is a truthy value so even if the checkbox was unchecked it will be marked as checked.
Related Posts Related Posts :
  • grab non-sibling element with jquery
  • Select a word and click it
  • Trigger modal instead redirect to /users/sign_in path, Rails 4 with devise
  • Combining Parent theme JS and CSS
  • Angular ui-grid - DropDown Selection shows Id
  • jquery addclass when there is content on body
  • JQUERY : CSS does not apply to dynamically created elements
  • Bootstrap multiselect dropdown checkbox not working on paginated table
  • JQuery scroll to dynamic id
  • Jquery first time tried ajax
  • Disable the link on the active tab (Bootstrap)
  • How to handle this validation when a div is added?
  • how to show/hide and check/uncheck checkboxes dynamically inside kendo grid
  • Conditional parameters for AJAX function
  • Jquery add class to input checkbox field
  • Bootstrap countdown timer Jquery
  • Open the closest modal of jQuery clicked element
  • change background color of specific button on click
  • Can I create link as post to 3rd party site and open in new tab?
  • ID is 'undefined' using .each()
  • Using .each() for targeting each child differently in Jquery
  • How to return data from functions in function
  • Execute this jquery only when viewport is bigger than
  • Bootbox showing white box behind dialog
  • Toggle multiple classes with prevAll(), nextAll(), slice(), and duplicate classes... better way?
  • Show/hide list items and add more/less link
  • Going through all occurences of class on slider change
  • Call jQuery valid() without updating the screen
  • hide and show ActionLink and save data in database - MVC
  • Pass each object in JSON array to query
  • Toggling content div on one-page site with jQuery
  • Foundation Equalizer is setting height to inherit?
  • carousel navigation each function
  • changing color of text color with input slider
  • jquery: filter using AND OR in selector
  • Call a function If any Item is chosen From select box , After Dom update
  • Target class within a jquery object
  • How to scroll a web page with fixed navigation bar just before arrive to a section or div?
  • How to add a class name to a specific selector
  • How to prevent background scrolling
  • How can I disable previous/next in OwlCarousel2 if there aren't enough items to scroll?
  • How to pass products and quantities to ASP.NET MVC4 Web API from form submit
  • jQuery css3 attribute not working
  • WordPress One Page Style Menus Scrolling
  • jquery.unobtrusive-ajax.js is not capturing the Submit event
  • Uncaught SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin '' in a call to 'postMessage'
  • jquery tooltipster plugin, hide all tips?
  • How to set 3 different colors at jQuery UI Slider
  • How to convert a string to html and add a event, descard after use?
  • How can I make jQuery wait for div display value to change to "block", then make ajax call?
  • Stellar.js giving uncaught type error
  • Saving form data to local storage and show it on refresh
  • Jquery carousel not being implemented
  • Use modal with external URL body and dynamic links from data attribute
  • Looking to simplify my jquery
  • Bootstrap datepicker query?
  • Navbar/header animated change on scroll
  • Bootstrap paginated table sending only 10 row's data to server
  • Bootstrap 3.0 & NiceScroll 3.5.0
  • Find me all inputs where ID ends with xyz except for a particular ID
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org