<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[devshare.de - Insertion.After Problem mit IE]]></title>
	<link rel="self" href="http://www.devshare.de/feed/atom/topic/41318/"/>
	<updated>2006-07-20T21:01:44Z</updated>
	<generator>PunBB</generator>
	<id>http://devshare.de/topic/41318/insertionafter-problem-mit-ie/</id>
		<entry>
			<title type="html"><![CDATA[Re: Insertion.After Problem mit IE]]></title>
			<link rel="alternate" href="http://devshare.de/post/46463/#p46463"/>
			<content type="html"><![CDATA[<p>Hallo,</p><p>das Problem bei Deinem Beispiel liegt daran, dass Du ja nicht nur ein INPUT Element erzeugst, sondern dieses in ein Label und eine P-Tag einbettest. Wenn man nun ein neues Element an das letzte INPUT hängen will (parts[]), wird dieses nach dem ersten Einfügen vom IE nicht gefunden. FF hängt den Content dann einfach an des INPUT-ELEMENT an .. der IE hat damit Probleme. Du könntest das Beispiel etwa wie folgt lösen:</p><div class="codebox"><pre><code>&lt;div id=&quot;add_sub&quot;&gt;
&lt;a href=&quot;#&quot; onclick=&quot;addPart(); return false;&quot; name=&quot;adds[]&quot;&gt;more&lt;/a&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var addPart = function() {
    var pc = document.getElementsByName(&#039;adds[]&#039;);
    var i = pc.length+1;
    var content = &#039;&lt;p id=&quot;adds[]&quot;&gt;&lt;label for=&quot;p&#039;+i+&#039;&quot;&gt;&#039;+i+&#039;. Email:&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;parts[]&quot; size=&quot;20&quot; class=&quot;txt&quot; id=&quot;p&#039;+i+&#039;&quot; /&gt;&lt;/p&gt;&#039;;
    new Insertion.After(pc[i-2], content);
}
&lt;/script&gt;</code></pre></div><p>vg<br />Hannes</p>]]></content>
			<author>
				<name><![CDATA[j|g]]></name>
				<uri>http://devshare.de/user/4/</uri>
			</author>
			<updated>2006-07-20T21:01:44Z</updated>
			<id>http://devshare.de/post/46463/#p46463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Insertion.After Problem mit IE]]></title>
			<link rel="alternate" href="http://devshare.de/post/46456/#p46456"/>
			<content type="html"><![CDATA[<p>Hi,</p><p>ich benutze prototype-1.4.0.js und habe Problem mit Insertion.After bei IE, hat jemand vielleicht schon damit Erfahrung gemacht und mir weiter helfen kann.</p><p>Die Code:<br /> -- JavaScript --</p><p>...<br />var addPart = function() {<br />&nbsp; &nbsp; var pc = self.document.getElementsByName(&#039;parts[]&#039;);<br />&nbsp; &nbsp; var i = pc.length + 1;<br />&nbsp; &nbsp; var content = &#039;&lt;p&gt;&lt;label for=&quot;p&#039;+i+&#039;&quot;&gt;&#039;+i+&#039;. Email:&lt;/label&gt;&lt;input type=&quot;text&quot; name=&quot;parts[]&quot; size=&quot;20&quot; class=&quot;txt&quot; id=&quot;p&#039;+i+&#039;&gt;&lt;/p&gt;&#039;;<br />&nbsp; &nbsp; new Insertion.After(&#039;pc[(pc.length-1)], content);<br />}<br />...</p><p>-- HTML --</p><p>...<br />&lt;div id=&quot;add_sub&quot;&gt;<br />&lt;a href=&quot;#&quot; onclick=&quot;addPart(); return false;&quot; name=&quot;add&quot;&gt;more&lt;/a&gt;<br />&lt;/div&gt;&#039;<br />...</p><p>funktioniert mit FireFox reibungslos. Mit IE nicht. IE bringt die Fehlermeldung:<br />die HTML-Quelle ist für diese Operation nicht gültig.</p><p>Danke!</p>]]></content>
			<author>
				<name><![CDATA[hoaianh]]></name>
				<uri>http://devshare.de/user/4688/</uri>
			</author>
			<updated>2006-07-18T07:12:59Z</updated>
			<id>http://devshare.de/post/46456/#p46456</id>
		</entry>
</feed>

