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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:29:18+00:00 2026-06-03T13:29:18+00:00

I have a search box: <input class=box name=search type=text id=search_input /> And a json_encode

  • 0

I have a search box:

<input class="box" name="search" type="text" id="search_input" />

And a json_encode array called $findall. Using jQuery $.ajax() I want to be able to pass the array AND the “keyword” from the input via the data field. The code below has set the keyword from the search_input as the variable dataString

$.ajax({
                type: "GET",
                url: "core/functions/searchdata.php",
                data: dataString,  
        //data:{availableDevicesArray : availableDevices },
                beforeSend: function() {
                    $('input#search_input').addClass('loading');
                },
                success: function(server_response) {
                    $('#searchresultdata').append(server_response);
                    $('span#category_title').html(search_input);
                }

I can pass either dataString or the array, but not both which I need. How is it possible to pass them both?

UPDATE:

My PHP to get the array is:

mysql_select_db($database_database_connection, $database_connection);
$query = "SELECT * FROM Device_tbl";
$result=mysql_query($query, $database_connection) or die(mysql_error());
$findall = array ();
while($row = mysql_fetch_array($result)){

    $findall[] = $row;
}

and I am storing the availbleDevices array like so:

var availableDevices = <? echo json_encode($findall); ?>;
  • 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-03T13:29:20+00:00Added an answer on June 3, 2026 at 1:29 pm

    You can create an object and push these variables as its properties:

    data: {
        'string' : 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
        'array' : [ 'one', 'two', 'three' ]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a input box which looks like below, <input id=basic-search type=text value=Enter keyword
I have an input box that as you type displays a div called suggestions
I have a search box on my site. The text displayed in the input
I have a search box on my site. If a student enters some text,
I have a UI with a search text box and a button that that
I have asp.net TextBox with ontextchanged event this is search text box in my
I have the JQuery AutoCompletion plug installed and working on 4 input text boxes,
id like to have an input box that a user can enter a search
Greetings, In my current project, I have gridview, search button, text box for search,
I have a text box in which when I type one letter say 's'

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.