UPDATED, TO BE MORE CLEAR:
My current field that contains the value ‘1201026404’ (which will change every time) :
<input id="ticket_fields_20323656" name="ticket[fields][20323656]" size="30" style="width:125px;" type="text" value="1201026404" tabindex="11">
The LI where I want the copied value ‘1201026404’ (which will change every time) to go when the page loads:
<ul class="multi_value_field" style="width: 99.5%;">
<li class="choice" choice_id="1201026404">1201026404<a class="close">×</a><input type="hidden" name="ticket[set_tags][]" value="1201026404" style="display: none;"></li>
</ul>
The Javascript that I have already made but need help with:
<script type="text/javascript">
copy = function()
{
var n1 = document.getElementById("ticket_fields_20323656");
var n2 = ‘what goes here??’
n2.value = n1.value;
}
</script>
does this work in firefox:
this uses querySelectorAll which doesnt exist in IE6,7,8 – otherwise you need to use the id of the element which im not sure you have