JavaScript and external JSON

Naancy Sheba

Naancy Sheba

@naancy-vGj1Yr Oct 26, 2024
{"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

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Naancy Sheba

    Naancy Sheba

    @naancy-vGj1Yr Feb 19, 2017

    Is the question is such a difficult one?? I cant get any answers still.

  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Feb 20, 2017

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

    @naancy-vGj1Yr Feb 20, 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

    @simplycoder-NsBEdD Mar 5, 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

    @james-malvi-5lp78d Mar 7, 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 <a href="https://jsonformatter.org" target="_blank" rel="nofollow noopener noreferrer">Best JSON Formatter and JSON Validator: Online JSON Formatter</a>

  • seth88

    seth88

    @seth88-T4Q96H Aug 28, 2017

    Use this tool to test, view, edit, and format your JSON: #-Link-Snipped-#. Other useful tool: #-Link-Snipped-#