<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Clear form with JavaScript</title>
	<atom:link href="http://www.redips.net/javascript/clear-form/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redips.net/javascript/clear-form/</link>
	<description>Techniques and Web Technologies</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:29:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/</generator>
	<item>
		<title>By: dbunic</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-4879</link>
		<dc:creator>dbunic</dc:creator>
		<pubDate>Wed, 04 Jan 2012 09:55:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-4879</guid>
		<description>@Kala - Well, &lt;strong&gt;&lt;input type=&quot;file&quot;&gt;&lt;/strong&gt; is the tricky one. Field value cannot be changed or reset (without doing a full form reset) for security reasons. Possible workaround could be to completely delete element from the form and to add it again - simply just replace it ;)

Here is link to &lt;a href=&quot;http://stackoverflow.com/questions/1043957/clearing-input-type-file-using-jquery&quot; title=&quot;Stackoverflow: Clearing type=file using jQuery&quot; rel=&quot;nofollow&quot;&gt;http://stackoverflow.com/&lt;/a&gt; with suggested solution in jQuery but it can be without jQuery as well.</description>
		<content:encoded><![CDATA[<p>@Kala - Well, <strong>&lt;input type="file"&gt;</strong> is the tricky one. Field value cannot be changed or reset (without doing a full form reset) for security reasons. Possible workaround could be to completely delete element from the form and to add it again - simply just replace it <img src='http://www.redips.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Here is link to <a href="http://stackoverflow.com/questions/1043957/clearing-input-type-file-using-jquery" title="Stackoverflow: Clearing type=file using jQuery" rel="nofollow">http://stackoverflow.com/</a> with suggested solution in jQuery but it can be without jQuery as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kala</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-4861</link>
		<dc:creator>Kala</dc:creator>
		<pubDate>Thu, 29 Dec 2011 04:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-4861</guid>
		<description>Can you please tell me how to clear the value if input type=&quot;file&quot;</description>
		<content:encoded><![CDATA[<p>Can you please tell me how to clear the value if input type="file"</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ahmad balavipour</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-4635</link>
		<dc:creator>ahmad balavipour</dc:creator>
		<pubDate>Thu, 10 Nov 2011 08:51:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-4635</guid>
		<description>Thanks a lot, very good code.</description>
		<content:encoded><![CDATA[<p>Thanks a lot, very good code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbunic</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-3928</link>
		<dc:creator>dbunic</dc:creator>
		<pubDate>Sun, 29 May 2011 11:31:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-3928</guid>
		<description>@harika - This clearForms() JavaScript function is exactly what you need. It will clear all form elements on the page. Just call clearForms() function in case of wrong input and form elements will be cleared.

In the meantime, clearFields function is verified with JSLint - now code looks clean and correctly indented.</description>
		<content:encoded><![CDATA[<p>@harika - This clearForms() JavaScript function is exactly what you need. It will clear all form elements on the page. Just call clearForms() function in case of wrong input and form elements will be cleared.</p>
<p>In the meantime, clearFields function is verified with JSLint - now code looks clean and correctly indented.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harika</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-3916</link>
		<dc:creator>harika</dc:creator>
		<pubDate>Thu, 26 May 2011 10:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-3916</guid>
		<description>I want code for clear a form before submit. Suppose if I enter anything wrong then I need to clear all fields in JavaScript.
Please give reply fast.</description>
		<content:encoded><![CDATA[<p>I want code for clear a form before submit. Suppose if I enter anything wrong then I need to clear all fields in JavaScript.<br />
Please give reply fast.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: writer jobs</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-3735</link>
		<dc:creator>writer jobs</dc:creator>
		<pubDate>Tue, 05 Apr 2011 12:17:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-3735</guid>
		<description>Thanks Man! that&#039;s help me a lot! If options are deleted from multiple-select then &quot;clear-form&quot; loop should not add previously deleted items ...</description>
		<content:encoded><![CDATA[<p>Thanks Man! that's help me a lot! If options are deleted from multiple-select then "clear-form" loop should not add previously deleted items ...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sol</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-2298</link>
		<dc:creator>Sol</dc:creator>
		<pubDate>Tue, 07 Sep 2010 22:20:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-2298</guid>
		<description>This worked as a charm.. thanks a mil for sharing...</description>
		<content:encoded><![CDATA[<p>This worked as a charm.. thanks a mil for sharing...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbunic</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-2108</link>
		<dc:creator>dbunic</dc:creator>
		<pubDate>Wed, 23 Jun 2010 12:34:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-2108</guid>
		<description>@Ravi - clearing form should not affect adding or removing &lt;em&gt;options&lt;/em&gt; in select or multiple-select. Loop goes through all multiple-select &lt;em&gt;options&lt;/em&gt; and sets &quot;selected&quot; property to &quot;false&quot;. If &lt;em&gt;options&lt;/em&gt; are deleted from multiple-select then &quot;clear-form&quot; loop should not add previously deleted items ...</description>
		<content:encoded><![CDATA[<p>@Ravi - clearing form should not affect adding or removing <em>options</em> in select or multiple-select. Loop goes through all multiple-select <em>options</em> and sets "selected" property to "false". If <em>options</em> are deleted from multiple-select then "clear-form" loop should not add previously deleted items ...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-2104</link>
		<dc:creator>Ravi</dc:creator>
		<pubDate>Tue, 22 Jun 2010 09:00:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-2104</guid>
		<description>Hi its nice article but how can I remove the list box items. I have the code as follows
&lt;pre class=&quot;brush:js&quot;&gt;
else if (FormName.elements[i].type == &#039;select-multiple&#039;) {
	for (index = FormName.elements[i].options.length - 1; index &gt;= 0; index--) {
		FormName.elements[i].options.remove(index);
	}
}
&lt;/pre&gt;
It is working fine in removing the elements but if i add new element after clearing, again previous elements are adding to the listbox...</description>
		<content:encoded><![CDATA[<p>Hi its nice article but how can I remove the list box items. I have the code as follows</p>
<pre class="brush:js">
else if (FormName.elements[i].type == 'select-multiple') {
	for (index = FormName.elements[i].options.length - 1; index &gt;= 0; index--) {
		FormName.elements[i].options.remove(index);
	}
}
</pre>
<p>It is working fine in removing the elements but if i add new element after clearing, again previous elements are adding to the listbox...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manjula</title>
		<link>http://www.redips.net/javascript/clear-form/comment-page-1/#comment-570</link>
		<dc:creator>Manjula</dc:creator>
		<pubDate>Tue, 25 Aug 2009 04:36:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=29#comment-570</guid>
		<description>Nice article. Thank you for sharing.</description>
		<content:encoded><![CDATA[<p>Nice article. Thank you for sharing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

