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

  • Home
  • SEARCH
  • 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 9021905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:22:08+00:00 2026-06-16T05:22:08+00:00

<form action=db.php method=POST id=addForm name=addForm> <input type=checkbox name=use[] value=development>Develop<br> <input type=checkbox name=use[] value=sample>Sample<br> <input

  • 0
<form action="db.php" method="POST" id="addForm" name="addForm">
<input type="checkbox" name="use[]" value="development">Develop<br>
<input type="checkbox" name="use[]" value="sample">Sample<br>
<input type="checkbox" name="use[]" value="mass_production">Mass Prod<br>
</form>

Just to clear up first..
1. If I submit, I can get the post values in php using the variable $_POST['use'] , right ?
2. Since its multiple checkbox, the values $_POST[‘use’] is an array, so I need to access it with $_POST['use'][0], $_POST['use'][1] , right ?

The real problem now is, when I submit, I received error in console (firebug).
Error: Syntax error, unrecognized expression: [name=use[]], and throw new Error( "Syntax error, unrecognized expression: " + msg );

The error prevent my submit.
I’m using jquery-1.8.2.js. Anything I do wrong ?

UPDATE
These codes below created the error. But still not understood yet.

var jdialog = $('#addnew_dialog');
var jform = jdialog.find('[name=addForm]');
jform.validate({
    errorClass : "err_label",
    wrapper: "li",
    rules: {
        "code": "required",
        "name": "required"
    },
    ignore: "",
    errorPlacement: function(error, element) {
        if( element.next().hasClass('ui-multiselect') ) {
            error.insertAfter( element.next() );
        } else {
            error.insertAfter( element );
        }
    },
    submitHandler: function(form) {
        //use ajax check
        //reset all error state
        $.each($(form).serializeArray(), function() {             
      jform.find("[name="+this.name+"]").removeClass("ui-state-error");
    });

        var data = ajaxCheck("addForm", "ajaxCheckAddShape");
        if(data['result']!="ok"){
            updateTips(data['msg']);
            $.each(data['err_fields'], function(index, value) {
                jform.find("[name="+value+"]").addClass("ui-state-error");
            });
            return false;
        }
        $(form).find("[name=op]").val("add");
        form.submit();
    }
});


function ajaxCheck(formName , action) {
    var jform = $("#"+formName);
    jform.find("[name=op]").val(action);
  var returnData = $.ajax({
    type: "POST",
    url: "db.php",
    async: false,
    timeout: 5000,
    data: jform.serialize(),
    dataType : "json"
  }).responseText;
  return $.parseJSON(returnData);
}
  • 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-16T05:22:09+00:00Added an answer on June 16, 2026 at 5:22 am

    In a jQuery attribute selector, you need to put quotes if you have characters like [ or ].

    For example replace

    $('[name=use[]]')
    

    with

    $('[name="use[]"]')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML form: <form action='process.php' method='post'> <input type='checkbox' name='check_box_1' /> Check me!<br>
<form action = settings.php method = post> Student ID*: <input type = text name
<?php echo $_POST['ss'];?> <form action=<?php echo $_SERVER['PHP_SELF'];?> method=post> <input name=ss type=text /> <input type=submit
I have this HTML: <form action='uploadhandle.php' method='POST' enctype=multipart/form-data> <input type='file' class='fileinput' id='photo1' name='photo1'> <input
Consider the following Mechanize form object #<Mechanize::Form {name f1} {method POST} {action f.php} {fields
for the following form <form action ='search.php' method = 'post'> <select name=filter> <option id=A
I do have a search form. <form method=get id=searchform action=<?php bloginfo('siteurl');?>> <div class=search_bx1><input type=text
In a php-script i have a form, method is post, action-attribute is empty, which
I write two file main.php and download.php . main.php echo<form action='download.php' method='post'> for(i =
$(function() { $(.preview).click(function() { $('#image').wrap('<form action=/index/upload.php method=post enctype=multipart/form-data id=imageform target=imageupload />'); $('#imageform').submit(); $('#image').unwrap(); var

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.