473,698 Members | 2,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

copying contents of billing addy to shipping addy

Hi all!

Can anyone show me how to use javascript to populate shipping address
form fields with pre-typed payment address details upon checking of a
checkbox next to the obligatory text "click here if the shipping
address is the same as the billling address"? I've looked everywhere
for it but surprizingly have had no luck!

Jun 16 '06 #1
3 6273
libsfan01 wrote:
Hi all!

Can anyone show me how to use javascript to populate shipping address
form fields with pre-typed payment address details upon checking of a
checkbox next to the obligatory text "click here if the shipping
address is the same as the billling address"? I've looked everywhere
for it but surprizingly have had no luck!


....
<input type="text" id="billingAddr ess" />
....
<input type="text" id="shippingAdd ress" />
....

<script>
....
document.getEle mentById("shipp ingAddress").va lue =
document.getEle mentById("billi ngAddress").val ue;
....
</script>

--
Dag.
Jun 16 '06 #2
Hi Dag

I've tried this and it doesn't work. Is something missing?

"
<head>
<script type="text/javascript">
document.getEle mentById("delfo rename").value =
document.getEle mentById("foren ame").value;
</script>
</head>

<body>
<form action="" name="" id="form" method="post">
<input type="text" id="forename" />
<input type="text" id="delforename "/>
<input type="submit" name="submit" value="submit" />
</form>
</body>

</html>
"
Dag Sunde wrote:
libsfan01 wrote:
Hi all!

Can anyone show me how to use javascript to populate shipping address
form fields with pre-typed payment address details upon checking of a
checkbox next to the obligatory text "click here if the shipping
address is the same as the billling address"? I've looked everywhere
for it but surprizingly have had no luck!


...
<input type="text" id="billingAddr ess" />
...
<input type="text" id="shippingAdd ress" />
...

<script>
...
document.getEle mentById("shipp ingAddress").va lue =
document.getEle mentById("billi ngAddress").val ue;
...
</script>

--
Dag.


Jun 16 '06 #3
libsfan01 wrote:
Hi Dag

I've tried this and it doesn't work. Is something missing?

"
<head>
<script type="text/javascript">
document.getEle mentById("delfo rename").value =
document.getEle mentById("foren ame").value;
</script>
</head>
Script outside a function in the head section is run immediately,
before your page is rendered. So while the sctipt statements is correct,
there is noting on the page yet to copy to or from...

<body>
<form action="" name="" id="form" method="post">
<input type="text" id="forename" />
<input type="text" id="delforename "/>
<input type="submit" name="submit" value="submit" />
</form>
</body>

</html>
"


Try this:

<head>
<script type="text/javascript">
function copyAddress() {
document.getEle mentById("delfo rename").value =
document.getEle mentById("foren ame").value;
}
</script>
</head>
<body>
<input name="chkCopy" type="checkbox" value="" onClick="copyAd dress();">
<label>Use billing adress</label>

<form action="" name="" id="form" method="post">
<input type="text" id="forename" />
<input type="text" id="delforename "/>
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>

--
Dag.

Jun 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
9626
by: Thomas Lotze | last post by:
Hi, another question: What's the most efficient way of copying data between two file-like objects? f1.write(f2.read()) doesn't seem to me as efficient as it might be, as a string containing all the contents of f2 will be created and thrown away. In the case of two StringIO objects, this means there's a point when the contents is held in memory three times.
2
12995
by: Scott | last post by:
Not sure if this is the right place to post this or not, but I am in the process of trying to find a Web Hosting/Isp Billing system that is reasonable in price and uses Access or SQL Server for a backend DB. I have found a couple that seem to do what I want, but are using FILEMAKER for their DB. Looking for something that will handle reoccuring billing as well as per project billing. Keeping up with client info, etc.... Also needs to...
1
2370
by: ML | last post by:
hello i need to write an sql which calculates # of billing cycles for an order for which ive order start and end date. the first invoice will be cut on the order start date. Also if i apply a coupon for lets say one month (30 days) to that order i need to calculate how many billing cycles that coupon will apply to. ive start and end date of coupon ina diff table for that order for eg: if an order was started on 1/15 and ended on 4/14...
2
1848
by: chris | last post by:
Hi there, I'd like to make a container div semi-transparent and its contents opaque. On the following page, the semi-transparency of the containing div is inherited by its children (whereas I'd like the "Pigeon In Motion" article to be fully opaque against its semi-transparent white background):
18
12805
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments received. No biggie, right? Well, here's my problem. I don't know how to tell access to modify everyone's account balance each month. And I can't just always assume that their monthly bill is $16 just because their balance is $16. If I do that...
6
4623
by: Chris Buckett | last post by:
Hi, I was just wondering if anyone has had any experience in developing a shipping matrix. We are based in the UK, and we need to ship both locally and internationally. Local shipping is priced by weight and doesn't matter about the number of packages, international shipping is by weight and package size, so we need to know the number of packages.
9
3751
by: Jess | last post by:
Hello, I tried to clear a vector "v" using "v.clear()". If "v" contains those objects that are non-built-in (e.g. string), then "clear()" can indeed remove all contents. However, if "v" contains built-in types (e.g. int), then "clear()" doesn't remove anything at all. Why does "clear()" have this behaviour? Also, when I copy one vector "v1" from another vector "v2", with "v1" longer than "v2" (e.g. "v1" has 2 elements and "v2" has...
4
1542
by: AlexW | last post by:
Hi I have a dataset which contains the entire contents of a database. During the course of my program some records are added. I am having difficulty trying to find an SQL command that will transfer the added rows in one go (without using a tableadapter which I'm told I can't define programmatically). What is the quickest way to add all the added records at once? (can I even do this?) do I have to define an enumerator and add each row...
9
3098
by: Trevor2007 | last post by:
Hi Everyone, Im New here, I am trying to copy the contents of a subform(Datatsheet view)and populate the subform(datasheetview) on the next screen with the contents it just copied from the previous subform(Datasheet view). the purpose is if the billing choices are the same for the next individuale beeing entered into the db insteead of having to re-type everything. the code I have only copies the last record in the subform (DataSheet...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9027
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.