Order form Javascript

Not api related but code related:

I’ve modified labels and fields with many order forms before. Trying to modify the labels for billing to shipping check box and the billing and shipping company fields. So the JS actually makes the changes. You can view it in the console. The page doesn’t render it, however, until you refresh the page. It’s like the change is getting over ridden? Anyone ever see this, have a work around etc?

Thanks!

1 Like

Hey John,

Can you give me the code snippet you are using and I’ll take a look?

Justin

Thanks @JustinHandley,

Like I said, in the console, the Company label is changed but doesn’t render util I refresh the form after loading it.

https://tm179.infusionsoft.com/app/orderForms/Personal-Theme-Test

Can you send the code your using so I can try it on a form in my app?

Hi @JustinHandley,

so I’m just statically getting the 2 items by tag using index 2 and 11 like so

var test=document.getElementsByTagName(‘label’);
test[2].innerHTML=‘Legal Entity Name’;
test[11].innerHTML=‘Legal Entity Name’;

In this form anyway, those are the correct indexes

@John_Borelli When using js to change an order form or shopping cart I’ve found that I need to bind to ajaxComplete and not document ready or window load otherwise I need refreshes to get things to work.

jQuery(document).bind(‘ready ajaxComplete’, function() {
–code goes here–
};

Thanks @Kevin_Larsen! Last time I tried using JQ in an order form, the form elements just sat there “spinning” on load so I thought JQ wasn’t permitted or something but I’ll give it a try again.

Thanks!

1 Like

You’re welcome and last time I checked Infusionsoft is loading jQuery v1.10.2 for the cart / order forms so you can try using that.

Did you get this working? Sorry - I’ve been slammed - didn’t mean to drop the ball on this one.