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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:54:01+00:00 2026-06-10T03:54:01+00:00

I am using jquery autocomplete on a form and trying to do a simple

  • 0

I am using jquery autocomplete on a form and trying to do a simple echo of what is selected upon submitting a form entry to verify my data is being read correctly. I am receiving the following message:

Notice: Array to string conversion in C:\xampp\htdocs\New\search.php on line 4
Array

Search.php Contents:

<?php

$dest_name = $_GET["dest_name"];
echo ["dest_name"];

?>

Html contnts:

<body>
<form method="GET" action="search.php">
    <div>
    <input type="text" id ="destination" name="dest_name"/>
    </div>
</form
</body>

autocomplete script

var destinations = [
        {value: "49 Degrees North Ski Area",label: "49 Degrees North Ski Area",id: "1"},
        {value: "Afton Alps",label: "Afton Alps",id: "2"},
        {value: "Al Quaal Recreation Ski Area",label: "Al Quaal Recreation Ski Area",id: "3"},
        {value: "Alpental",label: "Alpental",id: "4"},
        {value: "Alpine Meadows",label: "Alpine Meadows",id: "5"},
];

$(document).ready(function() {
    $("#destination").autocomplete({
        source: destinations,
        focus: function(event, ui) {
            $("#destination").val(ui.item.label);
            return false;
        },
        select: function(event, ui) {
            $("#destination").val(ui.item.label);
            $("#dest_id").val(ui.item.id);
            return false;
        }
    });
    $('#button').click(function() {
        alert($("#dest_id").val());
    });
});
  • 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-10T03:54:03+00:00Added an answer on June 10, 2026 at 3:54 am

    In line 4 use have displayed the array index instead of that you have to echo the variable which you have declared in line 3.i.e.,

    echo $dest_name;

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

Sidebar

Related Questions

I'm developing a form, and using jQuery UI Autocomplete. When the user selects an
I am using jQuery's auto-complete plugin for a simple search form. I am having
I am using Jquery autocomplete in my form. After selecting the value from autocomplete,
I'm trying to write some JQuery using the AutoComplete plugin to display a list
I'm using JSP and jQuery Autocomplete UI. I'm trying to pass the 'value' of
I am trying to validate my form using jquery but I cannot get it
I have a site with a form with autocomplete using jquery. It works fine,
Hi I am trying to implement a autocomplete field using Zend Jquery. I followed
I'm using jquery-ui autocomplete to validate some form inputs. I've got this code :
I'm trying to use the jQuery Autocomplete function to submit a form when an

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.