How can I dynamically set id for hidden fields in template file?? I want to display the value in the alert box later using JS.
Template file:
<table>
%for doc in docs:
<tr>
<td>
<a href = '' onclick="popup1();">Link</a>
<input type=hidden id="**do something here**" name="hidden" value="{{doc["Field"]}}" />
</td>
</tr>
%end
</table>
JS:
function popup1()
{
alert(document.getElementById("hiddenFieldID").value);
}
Can anybody suggest me what to do in do something here ???
Perhaps you do not need the ID
If you do
you can have
In jQuery:
using