Fill form from JSON data

Discussion in 'Programming' started by CircuitoX, May 5, 2022.

  1. #1
    I re-populate form with JSON data via javascript (all data has the same origin server)

    1 Wen the page load, make a request post ajax

    2 The response Ajax is a:

    Object { primary_ns: {…}, secondary_ns: {…} }

    Here is where I do the re-populate form, looping over Object.

    What do you think about this related to user experience or related to code maintenance or security ?
     
    CircuitoX, May 5, 2022 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,821
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #2
    It should be fine assuming you have control over the originating json - use jest or a testing tool to create automated tests you can run each week to check that everything still works.

    I have a monster form that my users fill in and can come back to edit, print etc and it's all loaded via that kind of mechanism.
     
    sarahk, May 6, 2022 IP
  3. CircuitoX

    CircuitoX Member

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #3
    thanks
     
    CircuitoX, May 6, 2022 IP