...

View Full Version : How do I make a text form field refresh in the browser.



garydr
03-21-2005, 10:26 PM
I have a form which reacts to a check box which says that the “Bill to” address should be the same as the “Ship to” address. When the check box is checked I run a function which copies the field values from the shipping address to the billing address. What i find is that the new values in the billing fields don’t display when the script completes, with the exception of Firefox. How do I force the form fields to refresh and appear on the screen? The code I’m using is a follows:


function copy_add(frm) {
// function to copy ship address to bill to address when same as box is checked.
//first check that the ship to name has been entered to signify that the ship
to fields have been entered
if ( frm.f_name.value == "" ) {
window.alert ( "Please complete the Ship to: address before
clicking the Same as check box." );
frm.f_same_addr.checked = ""; }
else {
frm.f_b_company.value = frm.f_company.value;
frm.f_b_name.value = frm.f_name.value;
frm.f_b_address.value = frm.f_address.value;
frm.f_b_city.value = frm.f_city.value;
frm.f_b_prov.value = frm.f_prov.value;
frm.f_b_country.value = frm.f_country.value;
frm.f_b_pc.value = frm.f_pc.value;
frm.f_b_hphone.value = frm.f_h_phone.value;
frm.f_b_wphone.value = frm.f_w_phone.value;
}
}

The check box that invokes it looks like:

<input name="f_same_addr" type="checkbox" id="f_same_addr" value="same"
<?php If ($_SESSION["same_add"] == "same") { echo "checked"; }; ?>
onChange="copy_add(document.f_order_form)">


Thanks in advance for any help available.

Gary

rwedge
03-22-2005, 12:41 AM
I can't really tell from your posted script, but make sure your alert is all on one line and does not break into a new line. Otherwise , it should run on IE.

/Bob



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum