Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I make a text form field refresh in the browser.

    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:

    Code:
    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

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •