<?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: Handling array of HTML Form Elements in JavaScript and PHP</title>
	<atom:link href="http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/feed" rel="self" type="application/rss+xml" />
	<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html</link>
	<description>Useful Tutorials, Scripts , Tips, and Resources for all PHP and Ajax beginners and experts .</description>
	<lastBuildDate>Mon, 07 May 2012 21:11:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Armenio Tamales</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-6549</link>
		<dc:creator>Armenio Tamales</dc:creator>
		<pubDate>Mon, 13 Jun 2011 22:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-6549</guid>
		<description>Thanks a lot. 
i really appreciate this post, it was what i was looking for.</description>
		<content:encoded><![CDATA[<p>Thanks a lot.<br />
i really appreciate this post, it was what i was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ntwobike</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-6433</link>
		<dc:creator>ntwobike</dc:creator>
		<pubDate>Wed, 23 Feb 2011 04:21:36 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-6433</guid>
		<description>hi
thanks for the good post.i have small problem i think you guys can easyly answer that.i want to change some elemnt value ( ex : education[1].value = 5 ) from javascript how do i do it :(</description>
		<content:encoded><![CDATA[<p>hi<br />
thanks for the good post.i have small problem i think you guys can easyly answer that.i want to change some elemnt value ( ex : education[1].value = 5 ) from javascript how do i do it <img src='http://roshanbh.com.np/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links london</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-6309</link>
		<dc:creator>links london</dc:creator>
		<pubDate>Sat, 22 Jan 2011 09:24:13 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-6309</guid>
		<description>Great post. Thanks for sharing.I am constantly searching online for articles that can aid me. Thanks!</description>
		<content:encoded><![CDATA[<p>Great post. Thanks for sharing.I am constantly searching online for articles that can aid me. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paulo</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-6278</link>
		<dc:creator>Paulo</dc:creator>
		<pubDate>Fri, 21 Jan 2011 02:02:21 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-6278</guid>
		<description>Thank you very much

I was going crazy over this business already.

Thank you for real!</description>
		<content:encoded><![CDATA[<p>Thank you very much</p>
<p>I was going crazy over this business already.</p>
<p>Thank you for real!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Data</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-5588</link>
		<dc:creator>Data</dc:creator>
		<pubDate>Wed, 11 Aug 2010 07:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-5588</guid>
		<description>I used a dynamic adding of row thru Javascript and HTML. My HTML name has already been appended. I placed: &quot;foreach($_POST[&#039;education&#039;] as $key=&gt;$value) echo $key.&#039; &#039;.$value;&quot; on a php page.. However it says, Warning: Invalid argument supplied for foreach().</description>
		<content:encoded><![CDATA[<p>I used a dynamic adding of row thru Javascript and HTML. My HTML name has already been appended. I placed: &#8220;foreach($_POST['education'] as $key=&gt;$value) echo $key.&#8217; &#8216;.$value;&#8221; on a php page.. However it says, Warning: Invalid argument supplied for foreach().</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ncomputing_gsi</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-5574</link>
		<dc:creator>ncomputing_gsi</dc:creator>
		<pubDate>Thu, 05 Aug 2010 17:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-5574</guid>
		<description>nice one. really helps a lot.</description>
		<content:encoded><![CDATA[<p>nice one. really helps a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bajarang</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-5569</link>
		<dc:creator>Bajarang</dc:creator>
		<pubDate>Mon, 02 Aug 2010 09:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-5569</guid>
		<description>This is really very good tutorial.</description>
		<content:encoded><![CDATA[<p>This is really very good tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ali</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-5234</link>
		<dc:creator>ali</dc:creator>
		<pubDate>Wed, 10 Mar 2010 13:46:28 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-5234</guid>
		<description>hello

how use out value in php code?</description>
		<content:encoded><![CDATA[<p>hello</p>
<p>how use out value in php code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: waseem</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4967</link>
		<dc:creator>waseem</dc:creator>
		<pubDate>Wed, 23 Dec 2009 08:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4967</guid>
		<description>nice stuff ,good script</description>
		<content:encoded><![CDATA[<p>nice stuff ,good script</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pligg.com</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4939</link>
		<dc:creator>pligg.com</dc:creator>
		<pubDate>Thu, 17 Dec 2009 20:08:13 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4939</guid>
		<description>&lt;strong&gt;Handling array of HTML Form Elements in JavaScript and PHP...&lt;/strong&gt;

Today, I would like to share the way of handling array of HTML FORM elements using JavaScript and PHP.Well, it&#039;s very easy to get the data from the array of HTML form elements in PHP and using them but in JavaScript it&#039;s a bit tricky to handle the ar...</description>
		<content:encoded><![CDATA[<p><strong>Handling array of HTML Form Elements in JavaScript and PHP&#8230;</strong></p>
<p>Today, I would like to share the way of handling array of HTML FORM elements using JavaScript and PHP.Well, it&#8217;s very easy to get the data from the array of HTML form elements in PHP and using them but in JavaScript it&#8217;s a bit tricky to handle the ar&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sarika</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4852</link>
		<dc:creator>sarika</dc:creator>
		<pubDate>Wed, 25 Nov 2009 05:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4852</guid>
		<description>it does not work in IE7</description>
		<content:encoded><![CDATA[<p>it does not work in IE7</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sethu</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4834</link>
		<dc:creator>Sethu</dc:creator>
		<pubDate>Fri, 20 Nov 2009 00:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4834</guid>
		<description>This is excellent article. I killed few hours/days. Thanks a lot. But this does not work in Firefox. Any work around??

Thanks
Sethu</description>
		<content:encoded><![CDATA[<p>This is excellent article. I killed few hours/days. Thanks a lot. But this does not work in Firefox. Any work around??</p>
<p>Thanks<br />
Sethu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4438</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Fri, 21 Aug 2009 11:52:22 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4438</guid>
		<description>Uuuuh, finally. This has been a pain ima  for a while. Couldn&#039;t figure out how to handle the arrays with JavaScript.

My deepest thanks for this article!</description>
		<content:encoded><![CDATA[<p>Uuuuh, finally. This has been a pain ima  for a while. Couldn&#8217;t figure out how to handle the arrays with JavaScript.</p>
<p>My deepest thanks for this article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: web2sms</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4388</link>
		<dc:creator>web2sms</dc:creator>
		<pubDate>Tue, 18 Aug 2009 07:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4388</guid>
		<description>the js part is not working in firefox.</description>
		<content:encoded><![CDATA[<p>the js part is not working in firefox.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4300</link>
		<dc:creator>Fabio</dc:creator>
		<pubDate>Fri, 31 Jul 2009 14:27:09 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4300</guid>
		<description>I found the solution for this question

When the array have only one value, you must get the hidden field by its id, in this case, the field must have its id equal its name. Like this:



When we going to acces its value, we have to do a try catch, like this:

try{
    myvar = document.myform.elements[&#039;namefield[]&#039;][index].value;
}catch(e){
    myvar = document.getElementById(&#039;namefield[]&#039;).value;
}

With this I resolved my problem, I hope that I had help.

PS: Sorry about the gramatical errors, I&#039;m still learning english.</description>
		<content:encoded><![CDATA[<p>I found the solution for this question</p>
<p>When the array have only one value, you must get the hidden field by its id, in this case, the field must have its id equal its name. Like this:</p>
<p>When we going to acces its value, we have to do a try catch, like this:</p>
<p>try{<br />
    myvar = document.myform.elements['namefield[]&#8216;][index].value;<br />
}catch(e){<br />
    myvar = document.getElementById(&#8216;namefield[]&#8216;).value;<br />
}</p>
<p>With this I resolved my problem, I hope that I had help.</p>
<p>PS: Sorry about the gramatical errors, I&#8217;m still learning english.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 3/19 queries in 2.057 seconds using disk: basic
Object Caching 412/412 objects using disk: basic

Served from: roshanbh.com.np @ 2012-05-21 18:42:56 -->
