JMR21 Posted November 25, 2020 Report Share Posted November 25, 2020 I am passing field values to an html datapage hosted on my website to create an invoice. Anytime there was a "#" included in an address, it would stop all the information following that point. I have incorporated the code from above and it does pass it on, but now I am getting "%20" anywhere there should be a space and "%23" where the # is included. Below is my code that I created from the examples on another help forum here. Do you see where I am creating this problem? I'm hoping it's something obvious! <a href="#" id="link-1">VIEW INVOICE</a> <script> // DO NOT TOUCH FROM THIS POINT var params = []; addParameter = function(qs, val){ params.push(`${qs}=${encodeURIComponent(val)}`); } //UP TO THIS POINT var link_id = "link-1"; var base_url = "https://janetrippe.com/invoice.html"; addParameter('fn', '[@field:FirstName]'); addParameter('ln', '[@field:LastName]'); addParameter('frn', '[@field:FarmRanchName]'); addParameter('ad1', '[@field:MailingAddress]'); addParameter('City', '[@field:City]'); addParameter('State', '[@field:State]'); addParameter('Zip', '[@field:Zip]'); addParameter('Phone1', '[@field:Phone1]'); addParameter('Phone1C', '[@field:Phone1Contact]'); addParameter('Phone2', '[@field:Phone2]'); addParameter('Phone2C', '[@field:Phone2Contact]'); addParameter('DA', '[@field:DeliveryAddress]'); addParameter('DC', '[@field:DeliveryDateComments]'); addParameter('DD', '[@field:BullDeliveryDate]'); addParameter('AAA', '[@field:AAAMemberCode]'); addParameter('Bid', '[@field:BuyerID]'); addParameter('TN', '[@field:TransferName]'); addParameter('Code', '[@field:AIMSid#]'); // DO NOT TOUCH FROM THIS POINT var queryString = params.join("&"); document.querySelector(`#${link_id}`).href = `${base_url}?${params.join("&")}` //UP TO THIS POINT </script> Here is a sample of what it is pulling; I have a # sign in the address as '4800 #1 Black Horse Pike'; it actually changed the # sign to %23 and the spaces to %20 Thanks so much for your help!! Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted November 30, 2020 Report Share Posted November 30, 2020 Replied here: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.