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??

Replies

  • Naancy Sheba
    Naancy Sheba
    Is the question is such a difficult one?? I cant get any answers still.
  • Kaustubh Katdare
    Kaustubh Katdare
    #-Link-Snipped-# - 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
    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
    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
    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 Best JSON Formatter and JSON Validator: Online JSON Formatter
  • seth88
    seth88
    Use this tool to test, view, edit, and format your JSON: #-Link-Snipped-#. Other useful tool: #-Link-Snipped-#

You are reading an archived discussion.

Related Posts

Hello, everyone. My purpose is simple. After finished civil engineering study we focus for grow up our engineer career.so,when we start our work in real life construction site, we face...
Capgemini India chief Srinivas Kandula feels that most of the nearly 4 million IT workforce comes from low-grade engineering colleges that do not have a proper grading system to show...
LG, the south Korean multinational electronics company has recently invited all its newsletter subscribers to an open event to be placed in Delhi on February 22. This is not the...
Apple has acquired 'RealFace' an Israeli startup that specialises in facial recognition. While the terms of the deal have not been made official yet, Israeli media is reporting the deal...
Money is hard to come by these days, but if you have it, then Flipkart is one of those shopping destinations you must immediately tune in to. Flipkart is currently...