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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:16:20+00:00 2026-06-10T07:16:20+00:00

This is my HTML <input data-provide=typeahead type=text id=actor name=actor autofocus=autofocus maxlength=30 value= required=required> I

  • 0

This is my HTML

<input data-provide="typeahead" type="text"  id="actor" name="actor" autofocus="autofocus" maxlength="30" value="" required="required">

I am using Ajax for source :

actors = getActors();
$('#actor').typeahead({
    source: actors,
    items: 10
});

If i keep my input div id as actor then everything thing works well but if change DIV id from actor to actor[] then typeahead is not working .

For actor[] id my code is :

<input data-provide="typeahead" type="text"  id="actor[]" name="actor" autofocus="autofocus" maxlength="30" value="" required="required" >

actors = getActors();
    $('#actor[]').typeahead({
        source: actors,
        items: 10
    });

If anybody know solution for this type input ID please your solution.

  • 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-10T07:16:21+00:00Added an answer on June 10, 2026 at 7:16 am

    Presumably jQuery’s selector engine is trying to interpret '#actor[]' as an element qualified by the presence of an attribute and isn’t matching. Why is it necessary to use that kind of an ID (a pair of empty square brackets is commonly used as a suffix on form element names so that PHP or similar code will convert the values of multiple elements with the same name into arrays, but IDs are by definition unique within a page)?

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

Sidebar

Related Questions

I have this HTML code for radios: <input type='radio' name='a_27' value='Yes' id='a_27_0' /> <input
Given this HTML: <form id=formx> <input type=text value= /> </form> And this JavaScript: $(function()
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
i have this html <ul> <li><form action=# name=formName></li> <li><input type=text name=someName /></li> <li><input type=text
I have this HTML: <form action='uploadhandle.php' method='POST' enctype=multipart/form-data> <input type='file' class='fileinput' id='photo1' name='photo1'> <input
Current HTML snippet: <ul class=ShippingProviderList> <li> <label id=shippingMethod_500dae76abe48_0> <input id=shippingCheck_500dae76abe48 type=radio value=0 name=selectedShippingMethod[500dae76abe48] />
Given this HTML: <div id=foo> <input type=button class=foo abtn_1> <input type=button class=joe bbtn_2> <input
Given this HTML: <div id=foo> <input type=button class=foo abtn_1> <input type=button class=joe bbtn_2> <input
Possible Duplicate: HTML Text Input allow only Numeric input I used this script function
this is html from <form action=http://localhost/own/import.php method=post enctype=multipart/form-data name=form1> <input type=file name=xmlfile id=file1> <input

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.