Go ahead - rip me a new one because This isn't PHP related. I have my titanium underoos strapped on tight.
I have a form on one page.
On that page is a link that makes an ajax call to add another form to a div.
I am trying to pass values from the form in the ajax call back to the parent form.
Within the form called via ajax:
$display .= $this->main->form->bottom("", $this->main->form->button("AddClient", "Add this Client", "onClick=\"passCPNewClientFormValues(this.form, document.step3);\""));
this.form is the form within the ajax-called script
document.step3 is the form within the script that made the ajax call
The code snippet is the function referenced above:
The function below is seeing the ajaxFormObject as empty, invalid or non-existent.
function passCPNewClientFormValues(ajaxFormObject,parentFormObject){
parentFormObject.cs_addr1.value = ajaxFormObject.cs_addr1.value;
parentFormObject.cs_addr2.value = ajaxFormObject.cs_addr2.value;
parentFormObject.cs_addr2.value = ajaxFormObject.cs_addr3.value;
parentFormObject.cs_city.value = ajaxFormObject.cs_city.value;
parentFormObject.cs_state.value = ajaxFormObject.cs_state.value;
parentFormObject.cs_zip.value = ajaxFormObject.cs_zip.value;
parentFormObject.cs_main_phone.value = ajaxFormObject.cs_main_phone.value;
parentFormObject.cc_direct_phone.value = ajaxFormObject.cc_direct_phone.value;
parentFormObject.cs_fax.value = ajaxFormObject.cs_fax.value;
parentFormObject.cc_mobile_phone.value = ajaxFormObject.cc_mobile_phone.value;
parentFormObject.cc_email.value = ajaxFormObject.cc_email.value;
}
Where am I going wrong here?
Thank in advance to those that can offer insight, as well as those that come up with the most creative insults.