JavaScript - How to add margin to field?

Hi all,

I am trying to add margin-right to a specific field on the Enter New Lead form.

let document = window.document;
document.getElementById("_Datalead_status").style.marginRight = "90px";

Above is the code I entered to the CreateScript to set the margin-right on the lead_status field to 90px (to push Assigned To a little further away).

Instead, I get the following error message:

lead_status jscript error: Expected ';' Line: 2 Char: 4
lead_status jscript error: Expected ';' Line: 2 Char: 4

Any advice that can help me would be hugely appreciated.

Thanks,

Paul

Parents Reply Children
  • 0 in reply to Paul Callaghan

    Is this code in the screen CustomContent?  If so you need to make it run when the page has finished loading:

    The marginRight style is for div elements though; "_Datalead_status" is a span so may not have any effect.

    (sorry - this stupid website will no longer let me post any code, hence the image.)