Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding innerHTML containing form
Message
De
19/10/2017 04:57:17
 
 
À
18/10/2017 18:02:32
Information générale
Forum:
Javascript
Catégorie:
DHTML
Divers
Thread ID:
01655077
Message ID:
01655083
Vues:
43
A JavaScript framework such as jQuery would save you time and hassle.


>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?
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform