Skip to content
Advertisement

Populate decoded data into dropdown

I am having 2 files, one to fetch ajax and to decode it. the other (page2.php) is modal popup in which I want to populate the received data from page1.php.

page1.php is below which returns invoice numbers perfectly.

JavaScript

page2.php is a modal where I try to get the received data and populate into a dropdown.

JavaScript

I know I am not looping the array to sort. I have tried different ways like below which didn’t work.

JavaScript

The error that I am getting in developer console is;

JavaScript

where I am stuck?

Advertisement

Answer

it was an easy fix.

page1.php had

JavaScript

page2.php

JavaScript

I am looping the invoices on page2.php based retrieving page1.php JSON. I decoded the json so it becomes a normal PHP array and looping through.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement