Quote:
Originally Posted by mattw
im trying to include additional fields in the copy
|
I haven't done this yet, but you should just need to add the lines to the javascript code. First find out which fields you want to copy and to where. A good way to do this is to look at the page's source code. Here are two sample methods that should both work:
Code:
// get additional fields by their id
var addField2 = document.getElementById('additional_values_2')
var addField3 = document.getElementById('additional_values_3')
addField2.value = addField3.value
Code:
// values from numbered form elements
form.elements[5].value = form.elements[6].value
The first example uses the id parameter of the input field. Mine looks like this:
Code:
<INPUT type="text" name="additional_values[2]" id="additional_values_2" size="32">
The second example gets the value by explicitly identifying which input element in the form has the value. You have to count the form elements starting with 0 to find this. It might take some trial and error and maybe using alert(form.elements[5].name) to help you identify the field you are trying to use.