Loading ...
Sorry, an error occurred while loading the content.

DOM manipulation (novice advice needed)

Expand Messages
  • hannadieter81
    Hello. I am new to javascript and want to implement a edit page for a one2many-realtionship. On the page there is a form for the main object and a dynamic
    Message 1 of 1 , Jul 2, 2007
    • 0 Attachment
      Hello.

      I am new to javascript and want to implement a edit page for a one2many-realtionship.
      On the page there is a form for the main object and a dynamic number of forms for all
      related objects. To add additional related objects, i have created a javascripted link, which
      dynamically expands my forms.

      Everything was fine, until somebody told me, that i should not use something like:
      document.getElementById('hops').innerHtml = document.getElementById('hops').innerHtml
      + formexpansion;

      I was told to use dom manipulation. Therefore I am doing this now:

      var form_astable = eval('(' + o.responseText + ')'); //comes from simplejason
      form_astable.appendTo(document.getElementById('hops'));

      which does not work.
      How do I create an element out of my simplejson-string-response, so that i am able to
      use the append method?

      Thanks in advance,
      Regards!
    Your message has been successfully submitted and would be delivered to recipients shortly.