Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8382203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:52:38+00:00 2026-06-09T16:52:38+00:00

I try to setup checkboxes and cannot get working simple code. Any clue? Thank

  • 0

I try to setup checkboxes and cannot get working simple code.

Any clue?

Thank you!

@{
    ViewBag.Title = "Web Reports - Peliculas";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
$(document).ready(function () {

        $("input[type='checkbox']").each(function(){
            var name = $(this).attr('name'); // grab name of original
            var value = $(this).attr('value'); // grab value of original

            alert(name); // It doesn't work at all :(
        });
    })​;
});
</script>

=================== UPDATE =============================

Generated code

<!DOCTYPE html>
<html>
<head>
    <title>MySite</title>
    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />

    <link href="/Scripts/jquery-ui-1.8.18/css/flick/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-ui-1.8.18/js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-ui-1.8.18/js/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-ui-1.8.18/development-bundle/ui/i18n/jquery.ui.datepicker.js"   type="text/javascript"></script>

      <script src="/Scripts/jquery-ui-1.8.18/development-bundle/ui/i18n/jquery.ui.datepicker-es.js" type="text/javascript"></script>



    <script type="text/javascript">
        $(function () {
            $('.datepicker').datepicker({
            });
        });

        $(document).ready(function () {
            $("#startDate").keyup(function () {
                $('#endDate').val($('#startDate').val());
            });
        });


    </script>
</head>
<body>
    <div class="page">
        <div id="header">
            <div class="user">
                    <span style="text-align: right;">Bienvenido, <strong>mobile
                    </strong>! <a href="/Home/LogOff">LogOff</a></span>
            </div>
            <div id="title" style="display: table-row; vertical-align: top;">
                <div style="display: table-cell; vertical-align: top;">
                    <a href="/">
                        <img src="/Images/b-default.jpg" width="370px"  alt=""  /></a>
                </div>
                <div style="display: table-cell; vertical-align: middle; width: 100%;">
                    <h1 style="text-align: right;">
                        Web Reports</h1>
                </div>
            </div>
        </div>
        <div id="main">
            <div class="clear">
            </div>
            <script type="text/javascript">
    $(document).ready(function () {


        $("input[type='checkbox']").each(function(){
            var name = $(this).attr('name'); // grab name of original
            var value = $(this).attr('value'); // grab value of original

            alert(name);
        });


})​;
    });
</script>
<h2>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:52:39+00:00Added an answer on June 9, 2026 at 4:52 pm

    There is an erroneous }) in your code try this:

    $(document).ready(function () {
            $("input[type='checkbox']").each(function(){
                var name = $(this).attr('name'); 
                var value = $(this).attr('value'); 
    
                alert(name); 
            });
         // })​;
    });
    

    As a sidenote you can use the val() method for getting/setting the value of checkboxes:

    var value = $(this).val(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to setup a project with spring-test using TestNg in Maven. The code
i try to setup a ubuntu server with web service that create by django/python
I have a Tomcat problem, i get this error everytime i try to setup
I have a really simple setup to try out a bidirectional mapping with annotations:
1) I try to setup a new web environment to host python + psycopg2
When I try to build my setup project, I get the following error: An
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
How do I setup logging in a grails unit-test? When I try log.info or
I need help getting setup on Seam 3 modules. When I try to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.