jeudi 1 décembre 2016

How to update database on change of checkbox? (Javascript)

How can I update the database when the user clicks on the Checkbox?
So when the checkbox is checked and the user clicks on it, then the database will update a value and the checkbox remains unchecked until its checked again.

<table>
  <tr>
    <td>
      <input type='checkbox' name='all' checked>
    </td>
    <td>
      <input type='checkbox' name='all'>
    </td>
  </tr>
</table>

I like to have this written in javascript.
I don't have any code because I don't have knowledge on how to build this. Please help me with this.




HTML search by two properties

I would like to be able to search for checkboxes which are not disabled (attribute disable is not set to "disabled":

My function is below. I am able to find all checkboxes, but I don't know how to search for not-disabled checkboxes:

 MarkAllColumns = function () {

if (MarkAll === true) {
  $("#tblArticlesSearch input[type=checkbox]").prop('checked', true);
}
else {
  $("#tblArticlesSearch input[type=checkbox]").prop('checked', false);
}

}

I want to set attribute checked to true only on not-disabled checkboxes.




DataGrid with checkbox doubleclick issue

I have a datagrid in Flex one column of datagriud contains checkboxes. I have itemDoubleClick event in DataGrid but every time i double click checkbox doubleclick event of datagrid gets called. I dont Want this. i Want double click event of checkbox to be called when double clicked on checkbox. Check This Image...




How to use for each in multiple control?

Im trying to clear all the field in textbox and uncheck all checkbox when the form on load

All my checkbox are inside TableLayoutPanel, but i have alot of TableLayoutPanel

Currently im using this method, but there is too many duplicate code

Private Sub ResetPage()      

    Dim ctrl As Control

    For Each ctrl In tlp_userInfo.Controls
        If TypeOf ctrl Is TextBox Then
            ctrl.Text = Nothing
        End If
        If TypeOf ctrl Is ComboBox Then
            ctrl.Text = Nothing
        End If
    Next

    For Each ctrl In tlp_chkb1.Controls
        If TypeOf ctrl Is CheckBox Then
            DirectCast(ctrl, CheckBox).Checked = False
        End If
    Next

    For Each ctrl In tlp_chkb2.Controls
        If TypeOf ctrl Is CheckBox Then
            DirectCast(ctrl, CheckBox).Checked = False
        End If
    Next

    For Each ctrl In tlp_chkb3.Controls
        If TypeOf ctrl Is CheckBox Then
            DirectCast(ctrl, CheckBox).Checked = False
        End If
    Next

End Sub

is that any other way to uncheck all the checkbox in diffrent TableLayoutPanel?




Getting wrong number of array of checkboxes when its checked

I have a loop of processes. And for each process there is checkbox:

</form>
for($y=0;$y<$len;$y++)
{   
    echo "<div class='proc'> <pre>";
    echo "<h6 >Process: ".$proc[$y]."      "   ;
    echo "People required: ".$num[$y].".      ";    
    echo "<input type='hidden' name='link[]' value='0'/><input type='checkbox' name='link[]' value='1'><i title='De-Activate Process' class='fi-link'></i>Connect Process</input></h6></pre>";
}
<input type = "submit" style="margin-left:300px; width:150px;" id="savebutton" name ="submit" class="button" value = "Create Project" onclick="userSubmitted = true;"/>
</form>

After submitting form I got the problem:

$process=$_POST['holdprocess'];
$number=$_POST['holdnumber'];
$link = $_POST["link"];

print_r($link);

foreach( $process as $proc => $eq ) 
{

    if($link[$proc]==1)
    echo "process: ".$eq." number: ".$number[$proc]." Process linked: yes<br>";
    else
    echo "process: ".$eq." number: ".$number[$proc]." Process linked: no<br>";
}

So if all checkboxes are eempty I got this: zero input When i check each checkbox system adds 0 to the array for each process: one input

Why does it happen? Thanks for any help




jquery checkbox prop not working

I'm trying to check/uncheck a checkbox using jquery 1.12.

this is my code:

<input type="checkbox" name="agreement" id="checkbox-3"/>
<button id="btn-agree">I Agree</button>
<button id="btn-notagree">Cancel</button>

<script>
$(document).ready(function() {
  $('#btn-agree').click(function() {
    $('#checkbox-3').prop('checked', true);
  });
  $('#btn-agree').click(function() {
    $('#checkbox-3').prop('checked', false);
  });
});

when I click the btn-agree, the function doesn't return any errors, but the checkbox is not checked. console.log($('#checkbox-3').prop('checked'); show true

can anyone point out what's wrong in my code?




mercredi 30 novembre 2016

Multiple Checkboxes in a Picture

i know how to put a picture in one checkbox (via css)

but this example: checkboxes

I want to put Checkboxes into the picture at every number exactly at this position. The checkboxes can also be next to the picture but at the exact positions.

How we do this ?

Thank you for your help