Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get selected checkbox items and pass to parameter for C# MVC consumption

var checkItems = $('[name="checkbox"]:checked');
            var combines = [];
            $.each(checkItems, function (i, arqs) {
                combines.push($(this).attr('data-combine'));
           });
            var param = {
                'cmbinedata': combines
            }
          
              $.ajax({
                url: '@Url.Action("YourMethodName", "YourCOntrollerName")',
                data: JSON.stringify(param),
                type: "POST",
                dataType: "json",
                contentType: 'application/json; charset=utf-8',
                success: function (result) {
                      //do something
                },
                error: function (err) {
                    tata.error('Error', "Error !!!");
                    location.reload();
                }
            });
Comment

PREVIOUS NEXT
Code Example
Javascript :: FTP upload local file 
Javascript :: javascript make variable 
Javascript :: online validator json schema 2020-12/schema 
Javascript :: remove console messages of react-i18next 
Javascript :: javascript auto detect if select input changed 
Javascript :: jq add variable 
Javascript :: requiere and get a property simplified with Node 
Javascript :: moment iso string to zero 
Javascript :: replace then replace back 
Javascript :: trim angular material input with ellipsis 
Javascript :: The slice reducer for key "books" returned undefined during initia 
Javascript :: circle rect collision 
Javascript :: spread operator shorthand javascript 
Javascript :: make a backend server in node 
Javascript :: Tableau JS api getdata 
Javascript :: javascript query corrector 
Javascript :: shopify hover effect 
Javascript :: jasmine configrations 
Javascript :: resource route or crud routs 
Javascript :: node get request filepath 
Javascript :: how to check null and undefined 
Javascript :: save specific attributes in table: sequelize 
Javascript :: Solana SPL Token JavaScript library mint function 
Javascript :: desctructuring in react with aliases 
Javascript :: How To Start Any Program In Background Using Vbscript 
Javascript :: node "promise.all" "retry" site:stackoverflow.com 
Javascript :: Example of AggregateError in es12 
Javascript :: how to calculate time difference in js 
Javascript :: isFinite(): returns true if the number is not Infinity or -Infinity 
Javascript :: nodejs express mongodb boilerplate 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =