<?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>Wed, 10 Mar 2010 10:59:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>
	<item>
		<title>By: Fabio</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4299</link>
		<dc:creator>Fabio</dc:creator>
		<pubDate>Fri, 31 Jul 2009 12:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4299</guid>
		<description>Nice tutorial, but I&#039;ve got the same problem as Raju, if the there&#039;s only one element, the form.elements[&#039;elementname[]&#039;] return null.

Does anyone have de solution?

thanks</description>
		<content:encoded><![CDATA[<p>Nice tutorial, but I&#8217;ve got the same problem as Raju, if the there&#8217;s only one element, the form.elements['elementname[]&#8216;] return null.</p>
<p>Does anyone have de solution?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kat</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4233</link>
		<dc:creator>kat</dc:creator>
		<pubDate>Wed, 22 Jul 2009 05:42:48 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4233</guid>
		<description>thank you so much for the article!been looking for this for a month now.sorry, im new to javascripting.i hav a question, how can i return the value of the array to php?
little help?thanks!:)</description>
		<content:encoded><![CDATA[<p>thank you so much for the article!been looking for this for a month now.sorry, im new to javascripting.i hav a question, how can i return the value of the array to php?<br />
little help?thanks!:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akinyele Olubodun</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4157</link>
		<dc:creator>Akinyele Olubodun</dc:creator>
		<pubDate>Wed, 01 Jul 2009 17:29:12 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4157</guid>
		<description>Thank you very much. I saw this tutorial at the right time. My head almost blew off finding a way to get value of my text field with JAVASCRIPT.</description>
		<content:encoded><![CDATA[<p>Thank you very much. I saw this tutorial at the right time. My head almost blew off finding a way to get value of my text field with JAVASCRIPT.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahesh</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4069</link>
		<dc:creator>Mahesh</dc:creator>
		<pubDate>Mon, 08 Jun 2009 03:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4069</guid>
		<description>This is indeed a good article. And thank you so much for it. Just would like to know how this would apply to a checkbox instead of a textbox. For a checkbox, you get all the values of the  not just the ones that are checked. How would you address that?</description>
		<content:encoded><![CDATA[<p>This is indeed a good article. And thank you so much for it. Just would like to know how this would apply to a checkbox instead of a textbox. For a checkbox, you get all the values of the  not just the ones that are checked. How would you address that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-4025</link>
		<dc:creator>Victor</dc:creator>
		<pubDate>Thu, 28 May 2009 08:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-4025</guid>
		<description>But, if they have something like this?:

&lt;input type=&quot;text&quot; name=&quot;data[1][name]&quot; value=&quot;name one&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;data[2][name]&quot; value=&quot;name two&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;data[3][name]&quot; value=&quot;name three&quot;&gt;

how can I access it with JavaScript?</description>
		<content:encoded><![CDATA[<p>But, if they have something like this?:</p>
<p>&lt;input type=&#8221;text&#8221; name=&#8221;data[1][name]&#8221; value=&#8221;name one&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;data[2][name]&#8221; value=&#8221;name two&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;data[3][name]&#8221; value=&#8221;name three&#8221;&gt;</p>
<p>how can I access it with JavaScript?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sharief</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-3949</link>
		<dc:creator>sharief</dc:creator>
		<pubDate>Fri, 08 May 2009 05:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-3949</guid>
		<description>Hi,

        Thanks for providing this.  Can you provide some useful tips like using &#039;array of HTML Form Elements&#039;   for writing code which can be very flexible in dealing large forms and whose fields may change dynamically.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>        Thanks for providing this.  Can you provide some useful tips like using &#8216;array of HTML Form Elements&#8217;   for writing code which can be very flexible in dealing large forms and whose fields may change dynamically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hardyboyz</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-3948</link>
		<dc:creator>hardyboyz</dc:creator>
		<pubDate>Fri, 08 May 2009 03:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-3948</guid>
		<description>Hai, nice tutorial. but i had a little problem with another kind in html array. The javascript can&#039;t run if the html form have an array like this :



What should i do first to get javascript can read those html array??? Please help..</description>
		<content:encoded><![CDATA[<p>Hai, nice tutorial. but i had a little problem with another kind in html array. The javascript can&#8217;t run if the html form have an array like this :</p>
<p>What should i do first to get javascript can read those html array??? Please help..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raju</title>
		<link>http://roshanbh.com.np/2008/08/handling-array-html-form-elements-javascript-php.html/comment-page-1#comment-3934</link>
		<dc:creator>Raju</dc:creator>
		<pubDate>Mon, 04 May 2009 18:07:23 +0000</pubDate>
		<guid isPermaLink="false">http://roshanbh.com.np/?p=240#comment-3934</guid>
		<description>Thanks a lot. I have spent  a lot of hours on this reading manuals and googling. But I found that it is not working if the array has only one value. The error  says that &quot;cannot convert undefined or null to object&quot;.  Any solutions ?

Raju</description>
		<content:encoded><![CDATA[<p>Thanks a lot. I have spent  a lot of hours on this reading manuals and googling. But I found that it is not working if the array has only one value. The error  says that &#8220;cannot convert undefined or null to object&#8221;.  Any solutions ?</p>
<p>Raju</p>
]]></content:encoded>
	</item>
</channel>
</rss>
