Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  


Copying fields with JS not working ...help
Dan Lebrun 31.Oct.07 02:56 PM a Web browser
Domino Designer -- Forms Release 5 Windows XP

Hi all,
I have a checkbox field called "SameAsBillingAddress" which, once cliked, is supposed to copy the values of some fields to other ones (from billing address fields to shipping adress fields).

When the user clicks on the checkbox in Firefox the following error message comes up saying :

I have received some advice. However, I do not know where to make the required change and I am still getting an error message (in FireFox) as follows:

//********************
form.SameAsMailingAddress has no properties
ShipToBillCustomer(form 42e04642140571508425...)42e04642140571508... (line 40)
onchange(change )42e04642140571508... (line 1)
[Break on this error] if (form.SameAsMailingAddress.checked) {
//********************

In the onChange event of the checkbox is the following JS code:
ShipToBillCustomer(this.form);

I made only one change to the code in the JSHeader event of the form and it’s the first line (new line to define “form”). I would like to make this work but I am not very well versed in JS. Stan, how do I pass both the checked property and the form into the function? How can I get the values copied from one set of fields (billing) to another set (shipping) when clicking on the checkbox field?

//****New line *****
var form = document.forms[0];
//*****************
var CustomerAddressShip = "";

var CustomerCityShip = "";

var CustomerStateShip = "";

var CustomerCountryShip = "";

var CustomerPostalCodeShip = "";


function InitSaveVariables(form) {

CustomerAddressShip = form.CustomerAddressShip.value;

CustomerCityShip = form. CustomerCityShip.value;

CustomerStateShip = form.CustomerStateShip.value;

CustomerCountryShip = form.CustomerCountryShip.value;

CustomerPostalCodeShip = form.CustomerPostalCodeShip.value;


}

function ShipToBillCustomer(form) {

if (form.SameAsBillingAddress.checked) {

InitSaveVariables();

form.CustomerAddressShip.value = form. CustomerAddress.value;

form.CustomerCityShip.value = form. CustomerCity.value;

form.CustomerStateShip.value = form. CustomerState.value;

form.CustomerCountryShip.value = form. CustomerCountry.value;

form.CustomerPostalCodeShip.value = form. CustomerPostalCode.value;

}

else {

form.CustomerAddressShip.value = CustomerAddressShip;

form.CustomerCityShip.value = CustomerCityShip;

form.CustomerStateShip.value = CustomerStateShip;

form.CustomerCountryShip.value = CustomerCountryShip;

}

}




Copying fields with JS not working ... (Dan Lebrun 31.Oct.07)
. . RE: Copying fields with JS not work... (Stan Rogers 31.Oct.07)
. . . . RE: Copying fields with JS not work... (Dan Lebrun 1.Nov.07)
. . . . . . RE: Copying fields with JS not work... (Rene Scheening 1.Nov.07)
. . . . . . . . RE: Copying fields with JS not work... (Dan Lebrun 1.Nov.07)
. . . . . . . . . . RE: Copying fields with JS not work... (Rene Scheening 1.Nov.07)
. . . . . . . . . . . . RE: Copying fields with JS not work... (Dan Lebrun 1.Nov.07)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search


 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow