0

What I'm trying to make is something like this. jsfiddle.net/zunrk/ I want to create a receipt that when you pick the data from the drop down it will show the details on other text box. The other problem is that i wanna create multiple textbox because there will be multiple items to be inserted. But i want the items coming from the mysql database not from an array.

2
Contributors
1
Reply
8
Views
3 Years
Discussion Span
Last Post by Fernando_4
0

There are a few options here.

/* BEFORE PAGE IS SENT */

1. When the page loads, grab the array you need from the database and pass it along to javascript with json_encode().

/* AFTER PAGE IS SENT */

2. Use AJAX's asynchronous xhr to a file that grabs that db array and use it directly in javascript.

2.1. If you're using jQuery you'll have the .post() method that has a callback with a data parameter that will be the array you recieve from that file, but it's basically an ajax request but with jQuery shorthand, just usefull if you're using it

Let us know what you've tried so we can try to give you an extra push^^

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.