Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4 Відповіді
4672 Переглядів
<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.

 


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
черв. 24
1695
1
груд. 23
1396
1
квіт. 23
1563
1
бер. 23
2388
0
груд. 22
1975