تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
4563 أدوات العرض
<t t-foreach="values" t-as="value">
<input type="hidden" t-att-value="value.editor1" id="aaa"/>

<script type="text/javascript">

var a= document.getElementById("aaa").value;

alert(a);
document.getElementById("kkkr").innerHTML = a;
</script>

<span id="kkkr"> </span>

here iam getting only first record every time

How to get all records present in the table
الصورة الرمزية
إهمال

log your values, whether its a dict or record

الكاتب

Yes these are dict values

I am getting only first record of table

الكاتب

Every time pf fpr loop my javascript getting only first recod insted of pointing to next id

أفضل إجابة

In your example foreach has every time the same input tag with id = "aaa". Many input lines (not array), but only one id. In this case Method

getElementById("aaa")

returns each time the value of the first line.   Change it to ... for example:  'aaa' + value.id
or organise as array.

 


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يونيو 24
1562
1
ديسمبر 23
1285
1
أبريل 23
1473
1
مارس 23
2306
0
ديسمبر 22
1880