Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding innerHTML containing form
Message
De
18/10/2017 18:02:32
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
DHTML
Titre:
Adding innerHTML containing form
Divers
Thread ID:
01655077
Message ID:
01655077
Vues:
42
I have a hit which transfers its content into the parent window into a div. Thus, I am using something like loDiv.innerHTML=HTMLCodeFromElsewhere. That HTML contains a form. The form appears ok on the page. However, when typing data into those fields, it is as is nothing was typed. A code like this would show blank values on input fields:
function Test()
{
   loElements=document.forms['Form1'].elements
   for (lnCounter=0; lnCounter<loElements.length; lnCounter++)
   {
      alert('Name: '+loElements[lnCounter].name+' ID: '+loElements[lnCounter].id+' Value: '+loElements[lnCounter].value)
   }
}
I have read somewhere that assigning HTML code to the innerHTML approach destroys the contents:

https://stackoverflow.com/questions/2192760/add-to-html-form-without-losing-current-form-input-information-in-javascript

However, in my case, the innerHTML I am passing is the HTML code for the full form. Is that approach supported?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform