how to get hidden value from specific form?

I tried to get element’s value from specific form. I have 100 forms because of FOREACH.. I can get Form name =1 form name =10 but I can’t get hidden values from the specific form. Can anyone help me? thanks.

[% FOREACH k_bilgi IN k_bilgiler %]
<form name='[% k_bilgi.i%]'>
<input type="hidden" name="itemnumberi" value="[% k_bilgi.itemnumber %]" />
<input type="hidden" name="returndate" value="[% k_bilgi.returndate %]" />
<input type="hidden" name="title" value="[% k_bilgi.title %]" />
<input type="hidden" id="author" name="author" value="[% k_bilgi.author %]" />
<input type="hidden" name="branchname" value="[% k_bilgi.branchname %]" />
</form>
[% END %]

my javascript code (b will be number 1 or 10 or 40)

function gonderildi(b) {
var div1 = document.forms[i];
alert(div1)     // this works.
var a = document.forms[i].elements['itemnumberi'];
alert(a);  // this is not work..


Source: forms

Leave a Reply