Naancy Sheba
Naancy Sheba
Branch Unspecified
19 Feb 2017

JavaScript and external JSON

{"value":[{"firstname":"naancy","email":"nancy@gmail.com","lastname":"sheeba",
"phone":"9791409681","address":"23,Iam Fine Street","city":"chennai","zip":"620012",
"country":"India"}]}
This is my external Json file.I am using HTML form elements to get the value of Email id if it matches all other values will be automatically filled.Suppose if the user wants to change the value of phone number.How could i update it in external JSON file??
Naancy Sheba

Naancy Sheba

Branch Unspecified
19 Feb 2017
Is the question is such a difficult one?? I cant get any answers still.
20 Feb 2017
@Naancy Sheba - Your question isn't very clear. Do you want to know how to update the remote JSON file? Is the file located on remote server? Or you simply wish to update the data that you've received?
Naancy Sheba

Naancy Sheba

Branch Unspecified
20 Feb 2017
I just want to update the Json file by using Javascript.
for eg. If the field of Phone number is change I need to call onchage() function to update in json
simplycoder

simplycoder

Branch Unspecified
05 Mar 2017
I do agree the question is pretty unclear, but anyway would still take a stab at it.
In general, you have such 'things' like a file located at server side.
Javascript(Referring to client side) can only pass a request to the server to manipulate to an extent where it passes the required data, and nothing beyond that.
Beyond this, you would require a sever side language to take care of the replacing logic (You can still use javascript if you have are using Node as your server).
Give us more information on these lines and we can help you out. It would be interesting to see what you have done until now. Lets make this interactive.

-Thanks and Regards
SC
James Malvi

James Malvi

Branch Unspecified
07 Mar 2017
use onchange method to catch event and based on email address, you can identify the json object, modify it and you have the update json object, now you can convert that to JSON data string. to test your json data you can use JSON Formatter and Validator: Advance JSON Formatter with JSON tools
seth88

seth88

Branch Unspecified
29 Aug 2017
Use this tool to test, view, edit, and format your JSON: JSON Formatter. Other useful tool: Javascript obfuscator

Share this content on your social channels -

Only logged in users can reply.