0
<cfset fedexReply = fedexShipper.processShipmentRequest(
            shipToName = "#form.TO_Company#",
            shipToCompany = "#form.TO_Company#",
            shipToPhone = "#form.TO_Telephone#",
            shipToEmail = "#form.TO_Email#",
            shipToAddress1 = "#form.TO_Address1#",
            shipToCity = "#form.TO_City#",
            shipToState = "#form.TO_State#",
            shipToZip = "#form.TO_ZIPCode#",
            shipToCountry = "#form.TO_Country#",
            shipToResidential = #form.ResidentialAddress#,

How can I get the value of ship To Residential so that I can use it in my other form.

Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
jacob
  • 21
  • 2

1 Answers1

0

This looks like a server-side code, maybe CodeFusion?

It will render a form for you with an input field like this:

<input name="shipToResidential">

If there is also an ID with the same attribute value, for example:

<input name="shipToResidential" id="shipToResidential">

Then you can just use document.getElementById('shipToResidential')

Otherwise you'll have to traverse the document:

var os=document.getElementsByTagName('input');
var addr='';
for (var i=0;i<os.length;i++){
  if (os[i].attributes['name']&&os[i].attributes['name'].value=='shipToResidential')
  addr=os[i].attributes['name'].value;
}
Schien
  • 3,855
  • 1
  • 16
  • 29