how to create a form with a submit button and call a json webservice?
-
Hi i have a webservice that output data with json format. I need to create a basic form with one field named: SKU and a submit button.
After client clicks Submit button, it should call the webservice passing tru a variable for example:
https://wsURL:8090/ConsultaTarjetas/ExistenciaProd/ExistenciaProd.php?token=abcbdefgh123456789&reference=$SKU, this is the variable that came from wordpress form field named SKU
and shows a json results like:
{ "success": true, "id": "22237897", "producto": "CAMISA MC OCEAN PACIFIC NAVY", "tallas": [ "XS ", "S ", "M ", "L ", "XL ", "XXL", "3XL", "4XL", "1X ", "2XL" ], "sucursales": [ { "nombre": "ALBROOK", "numtienda": "8.0", "numbodega": "0102", "precio": "24.989999999999998", "existencia": [ "0", "0", "1", "2", "1", "0", "0", "0", "0", "0" ] }, { "nombre": "LOS PUEBLOS", "numtienda": "5.0", "numbodega": "0105", "precio": "24.989999999999998", "existencia": [ "0", "1", "2", "1", "1", "0", "0", "0", "0", "0" ] }, { "nombre": "CHITRE MEN", "numtienda": "16.0", "numbodega": "0106", "precio": "24.989999999999998", "existencia": [ "0", "1", "0", "2", "0", "0", "0", "0", "0", "0" ] }, { "nombre": "TERRONAL", "numtienda": "14.0", "numbodega": "0908", "precio": "24.989999999999998", "existencia": [ "0", "1", "2", "2", "0", "0", "0", "0", "0", "0" ] }, { "nombre": "DAVID", "numtienda": "9.0", "numbodega": "0909", "precio": "24.989999999999998", "existencia": [ "0", "1", "2", "2", "1", "0", "0", "0", "0", "0" ] }, { "nombre": "COSTAVERDE MEN", "numtienda": "22.0", "numbodega": "0204", "precio": "24.989999999999998", "existencia": [ "0", "1", "2", "2", "0", "0", "0", "0", "0", "0" ] }, { "nombre": "CAROLINA 2", "numtienda": "21.0", "numbodega": "0111", "precio": "24.989999999999998", "existencia": [ "0", "0", "2", "2", "1", "0", "0", "0", "0", "0" ] }, { "nombre": "CENTENNIAL", "numtienda": "25.0", "numbodega": "0112", "precio": "24.989999999999998", "existencia": [ "0", "1", "2", "1", "0", "0", "0", "0", "0", "0" ] }, { "nombre": "SANTIAGO MALL", "numtienda": "26.0", "numbodega": "0113", "precio": "24.989999999999998", "existencia": [ "0", "0", "2", "2", "1", "0", "0", "0", "0", "0" ] }, { "nombre": "PENONOME BOULEVARD", "numtienda": "30.0", "numbodega": "0117", "precio": "24.989999999999998", "existencia": [ "0", "0", "2", "2", "1", "0", "0", "0", "0", "0" ] } ] }
and i need to construct or show a table with that json, if result is False and fails, should show a error msg
at the end table should look like this:
thank you
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘how to create a form with a submit button and call a json webservice?’ is closed to new replies.