Member-only story

How To Insert Ajax Result In A Text Field

Bipsmedium
4 min readJul 28, 2020

--

In this tutorial, we are going to learn how to insert ajax results in the text field. Most of the ajax request is sent via get method but here we will use the post method. As said earlier, we will send the ajax request first and take the response from the database in JSON format.

Also Read, How to append data to dropdownlist using Jquery Ajax PHP

First, we must have the tables. Here I am using two tables, city and pin codes.

DDL information of the table ‘city’
— — — — — — — — — — — — — -
CREATE TABLE `city` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`state_id` int(10) DEFAULT NULL,
`city_name` varchar(225) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

--

--

Bipsmedium
Bipsmedium

Written by Bipsmedium

Hi, This is Biplab and I am a PHP laravel developer and other open source technologies. I am here to share my experience with the community.

No responses yet