Click here to Skip to main content
14,732,694 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I have a table like below
<div class="datatable-tools">
            <table class="table" id="tblInfo">
                <thead style="font-size:14px;">
                    <tr>
                       
                        <th>Name</th>                   
                        <th>Years</th>
                        <th>Months</th>
                        <th>Number</th>
                        <th>Number2</th>
                        <th>Number3</th> 
                        <th>Gender</th> 
                    </tr>

                </thead>
                <tbody></tbody>
            </table>
        </div>



In that table Gender is a list value .. is there a way i can show the selected value in the table row along with other data using jquery

Gender is hardcoded in html's

<select class="form-control" tabindex="23" id="ddlSex">
                    <option value="0">Select</option>
                    <option value="M">Male</option>
                    <option value="F">Female</option>                    
                </select>



when i tried to do it.. it is showing the value of that selected one in the table
like Gender = M instead of Male


assigning the selected value like this Sex: $("ddlSex").val(),

passing all the details to a table

$.each(Details, function (i, item) {
                var memberModel = [                   
                    item.Name,
                    item.Years,
                    item.Months,
                    item.Gender,
                    item.Number,
                    item.Number2,
                    item.Number3,                    
                ];
                DetailsArray.push(memberModel);

            });
        var thisTable = $('#member').dataTable();
            thisTable.fnClearTable();
            thisTable.fnAddData(DetailsArray);
            thisTable.bDeferRender = true;

Can anyone help here plz
Posted
Updated 15-Jan-16 12:28pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900