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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:08:42+00:00 2026-06-12T21:08:42+00:00

Currently, my typeahead looks like this when I am creating it in php echo

  • 0

Currently, my typeahead looks like this when I am creating it in php

    echo '<input type="text" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="[,';
while ( $rowresult = mysql_fetch_assoc($titlequery) ) {
      echo '{value:&quot;'.htmlspecialchars($rowresult['title']).'&quot;'."},";
}
      echo ']">';

It outputs like this:

  <input type="text" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="[,{value:&quot;2010-11 Graf Intern&quot;},{value:&quot;2nd Year Finance Explorer, Mizani &amp; L'Oreal Technique&quot;},{value:&quot;A&amp;R Intern&quot;},{value:&quot;Account Executive&quot;},{value:&quot;Account Manager&quot;},{value:&quot;Account Service Representative&quot;},{value:&quot;Account Strategist&quot;},{value:&quot;Accountant&quot;},{value:&quot;Accounting Intern&quot;},{value:&quot;Accounting Intern/Analyst&quot;},{value:&quot;Accounts payable&quot;},{value:&quot;Acquisition Marketing Intern&quot;},{value:&quot;Acquisitions Associate&quot;},{value:&quot;Acting Manager&quot;},{value:&quot;Acting Software Manager&quot;},{value:&quot;Administrator&quot;},{value:&quot;Admissions Ambassador&quot;},]">

Unfortunately, it only shows the first character of each value it is able to find (value being the default for bootstrap.)

Edit:

The question revolved around formatting results, in actuality, what was happening was Javascript was trying to reference an array that didnt exist, so it took the element [0] which was the first character to it.

  • 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-12T21:08:43+00:00Added an answer on June 12, 2026 at 9:08 pm

    Try to use this solution:

    <?
    $chars = array(":", "'", "?", '"', "/");
    while ( $rowresult = mysql_fetch_assoc($titlequery) ) {
          $Str = $rowresult['title'];
          $Data[] = str_replace($vowels, "", $Str);
    }
    if(isset($Data)): ?>    
    <input type="text" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="[<?= implode(',', $Data) ?>]">
    <?php endif; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have this code: <?php echo '<meta name=robots content=noindex>'; $arr = json_decode(file_get_contents(http://media1.clubpenguin.com/play/en/web_service/game_configs/ paper_items.json),true);
Currently I am adding object by creating it like: type TRecord = class private
Currently I know of only two ways to cache data (I use PHP but
Currently, my ListViews look like this: How can I achieve that Windows 7 native
Twitter bootstrap comes with a very handy auto-complete like component called typeahead. I am
currently i have <div class=rightBoxesTop> <h3>My Pages</h3> <h3 style=line-height: 8px; width: 80px; font-size: 80%;
Currently I use /etc/init.d/supervisor restart but this restarts all processes under supervisor. Is there
Currently I'm using the Jackson JSON Processor to write preference data and whatnot to
Currently I have a UITableview, I have enough data that cannot be shown entirely
Currently I am debugging the signing of an Android app. And this would be

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.