JavaScript Copying value from one text field to another
I have created a button to run the following actions:
- Mouse Down > Execute a menu item > File>Print...
- Mouse Down > Run a JavaScript as follows
function copyToAnother()
{
var text1 = document.getElementById(id_of_first_text_field);
var text2 =document.getElementById(id_of_second_text_field);
text2.value = text1.value; // copy value of Ist field into second Field
}
This is to try to copy a numerical vale from a text field (Text1) to another text field (Text2)
3. Mouse Down > Reset a form (all fields except Text2)
4. I then want to use a JavaScript to autosave the form
5. When this saved file is opened, I want to use a JavaScript to move the value from the Text2 field to the Text1 field
I would like to do this with using a global object for sequential numbering. So far, my JavaScript doesn't seem to produce results. Is there an easier way to accomplish the above tasks?
