vendredi 24 août 2018

How to get the checkbox value in javascript or jquery?

I already tried all the possible ways, but I still didn't get it working. I have a modal window with a checkbox and submit button. What I need to do is onclick add button, a modal will opens and in that checkbox will be displays already stored value. "What is my concept is for example: In a page, if I have a device and I need to enter all the specifications about the device. So, I need to enter the second device on the page, I have provided an add button to add the specification. This is my concept" So I have done a lot of new modal in this method. Now what I am trying to do is, In case I missed a parameter in insertion in the first time of inserting the device. So I need to insert it for the specific device. Thinks I need to know! 1. I didn't know how to checkbox check or uncheck should be based on a database value. 2. For example, I have used a master data, for including it to a device while inserting the first time. "So I have used a foreach method and fetch the data through checkbox" You may see the example below hoI i used it!

<div class="form-body pal">
        <div class="col-md-6">
                <div class="form-group"><label class="control-label">{attribute_name module=engg attribute=properties}<span class='require'>*</span></label>
                        <div class="input-icon right">
                {foreach name=list item=item key=key from=$test_paralist}
                                <input type="checkbox" name="aequip_para_name[]" id="aequip_para_name" value="{$item.object_id}" class="form-        control">&nbsp;&nbsp;"{$item.parameter}<br>
                                {/foreach}
                        </div>
                </div> 
        </div>                                                        
</div>
  1. I need to insert the missed data for a device in the checkbox method. what's my requirement is. "First i have already inserted some data in the database, how its to validate is while inserting second time new value to the device, the already enter checkbox data should not shown that is by while onclick add button. Only the remaining master data need to be shown.

I used the ajax concept for fetch the data for javascript.

$(document).ready(function() {
    $("#test_parameter_add").click(function(){
                x_get_equip_test_filtered_parameter($("#test_parameter_add").   val(),get_equip_test_filtered_parameter);
    });
});

Please help me to write the below function method, the checkbox value to validate and shows only the new value not the already entered value.

function get_equip_test_filtered_parameter(result) {

}
My Ajax concept is working fine. i need javascript or jquery methods. please help as soon as possible

Thanks is advance!!!




Aucun commentaire:

Enregistrer un commentaire