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 6474497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:35:37+00:00 2026-05-25T06:35:37+00:00

Using the jquery form plugin. I was trying to test the value of a

  • 0

Using the jquery form plugin. I was trying to test the value of a form element that uses square brackets.

            var form = jqForm[0];
            if (!form.sendTo\\[\\].value) {                
              alert('Something'); 
              return false; 
            }

Despite trying to escape the brackets it is still giving me a an error.

illegal character

[Break On This Error] if (!form.sendTo\[\].value) {

is it not possible to do this?

Thanks

  • 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-05-25T06:35:38+00:00Added an answer on May 25, 2026 at 6:35 am

    you can use a square brackets and a string in place of dot-notation in javascript. So try this:

    var form = jqForm[0];
    if (!form["sendTo[]"].value) {                
       alert('Something'); 
       return false; 
    }
    

    Edit after comments:

    Using jQuery you can determine how many checked checkboxes there are using code such as:

    $('input[name="sendTo[]"]:checked',form).length
    

    assuming form is a jQuery object referencing the form containing the checkboxes. if it’s not, you should be able to wrap it like $(form) in the example above.

    Live example: http://jsfiddle.net/TMSsq/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jquery plugin, uniform so that on my form I can
I am using this jQuery form validation plugin: http://docs.jquery.com/Plugins/Validation/Methods I am trying to use
I'm trying to validate a form using the validate plugin for jquery. I want
I'm trying to validate a form using jquery validate plugin and I'm having a
I have a form that i am validating using jquery the validation plugin. What
I'm trying to validate a php register form using valid8 jquery plugin. i need
I'm using the jQuery form plugin and trying to figure out why I can't
I send asynchronous call using jQuery form plugin and in the case of success
I'm using jquery with the jquery form plugin . I read through a bunch
I'm using the jQuery Form plugin to upload an image. I've assigned a fade

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.