I have this page that has a variable number of text fields, each named item_#### where #### is the ID of the item the text field is representing. I would like to auto-populate these fields with how much of the item is in stock after the user clicks a button. The JSON return wouls look like this:
[#### : 45], [#### : 62]
(note the lack of item_ in the key)
I’m having trouble working my head around how I can load that data into multiple text fields based on the returned results of a php script. I would assume a loop would be in order, however I’m extremely new to Javascript and jQuery, so I’m lost when it comes to loading this content dynamically…
The data format is not clear, but you could do something like this: