<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум PHP-MyAdmin.RU &mdash; innerHTML как сделать чтобы неочищал поля в диве при добавлении новог]]></title>
	<link rel="self" href="https://forum.php-myadmin.ru/extern.php?action=feed&amp;tid=2977&amp;type=atom" />
	<updated>2013-06-26T16:56:27Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.php-myadmin.ru/viewtopic.php?id=2977</id>
		<entry>
			<title type="html"><![CDATA[Re: innerHTML как сделать чтобы неочищал поля в диве при добавлении новог]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=23311#p23311" />
			<content type="html"><![CDATA[<p>ответ на вопрос был найден<br /></p><div class="codebox"><pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;&lt;/title&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
        &lt;script&gt;
            function addForm() {
                var form = document.getElementById(&#039;f1&#039;);
                var node = document.createElement(&#039;input&#039;);
                var br = document.createElement(&#039;br&#039;);
                node.setAttribute(&#039;name&#039;, &#039;text&#039;);
                form.appendChild(node);
                form.appendChild(br);
            }
        &lt;/script&gt;
 
    &lt;/head&gt;
    &lt;body id=&quot;b1&quot;&gt;
        &lt;form id=&quot;f1&quot; &gt;
            &lt;input id=&quot;in1&quot; type=&quot;text&quot;/&gt;&lt;br/&gt;
        &lt;/form&gt;
    &lt;/body&gt;
    &lt;a href=&quot;javascript:void&quot; onclick=&quot;addForm()&quot;&gt;Add form&lt;/a&gt;
&lt;/html&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[BesTime]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4989</uri>
			</author>
			<updated>2013-06-26T16:56:27Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=23311#p23311</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[innerHTML как сделать чтобы неочищал поля в диве при добавлении новог]]></title>
			<link rel="alternate" href="https://forum.php-myadmin.ru/viewtopic.php?pid=23307#p23307" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>document.getElementById(&#039;add_form&#039;).innerHTML += &quot;&lt;input type=text name=text&gt;&quot;;</code></pre></div><p>таким способом создаю несколько текстовых полей при клике на кнопку добавить еще одно поле. Все работает но проблема в том что если есть уже заполненое поле 1 с текстом, при клике добавления поля2, поле1 очищается. Как сделать чтобы при добавлении поля2 текст в поле1 не очищался?</p>]]></content>
			<author>
				<name><![CDATA[BesTime]]></name>
				<uri>https://forum.php-myadmin.ru/profile.php?id=4989</uri>
			</author>
			<updated>2013-06-25T20:40:39Z</updated>
			<id>https://forum.php-myadmin.ru/viewtopic.php?pid=23307#p23307</id>
		</entry>
</feed>
