I have a checkbox that will enter our company address into the address fields when checked, but when unchecked the user has the option to enter their own address.
This works fine until it comes to saving the document. When the checkbox is unchecked and the user enters their own address and then saves the document, the javascript is removing the user entered address.
Here is the code:
<event activity="initialize" name="event__initialize">
<script>if ($.rawValue eq 1) then
form1.Main.Address1="blah blah Street"
City = "London"
ZipCode = "WC1N XXX"
Country = "UK"
elseif (ros.rawValue eq 1) then
form1.Main.Address1="blah blah Street"
City = "London"
ZipCode = "WC1N XXX"
Country = "UK"
else
Address1 = null
City = null
ZipCode = null
Country = null
endif
</script>
</event>
<event activity="change" name="event__change">
<script>if ($.rawValue eq 1) then
form1.Main.Address1="blah blah Street"
City = "London"
ZipCode = "WC1N XXX"
Country = "UK" elseif (ros.rawValue eq 1) then
form1.Main.Address1="blah blah Street"
City = "London"
ZipCode = "WC1N XXX"
Country = "UK"
else
Address1 = null
City = null
ZipCode = null
Country = null
endif
</script>
</event>
Any ideas?
EDIT:
It's this part of the script that is causing it:
else
Address1 = null
City = null
ZipCode = null
Country = null
I need a way to say user-entered-data:
else
Address1 = user-entered-data
City = user-entered-data
ZipCode = user-entered-data
Country = user-entered-data
(Notes: I am saving it as a reader-extended pdf so the text entered in the fields by the user can be saved)
Thanks in advance