CrazyEngineers
  • Naancy
    Naancy

    MemberFeb 19, 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??
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Naancy Sheba

    MemberFeb 19, 2017

    Is the question is such a difficult one?? I cant get any answers still.
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorFeb 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?
    Are you sure? This action cannot be undone.
    Cancel
  • Naancy Sheba

    MemberFeb 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
    Are you sure? This action cannot be undone.
    Cancel
  • simplycoder

    MemberMar 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
    Are you sure? This action cannot be undone.
    Cancel
  • James Malvi

    MemberMar 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>
    Are you sure? This action cannot be undone.
    Cancel
  • seth88

    MemberAug 28, 2017

    Use this tool to test, view, edit, and format your JSON: #-Link-Snipped-#. Other useful tool: #-Link-Snipped-#
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register