Skip to content

Instantly share code, notes, and snippets.

@amcn84
amcn84 / addAgentIDallForms
Created August 11, 2017 01:20
addAgentID all forms
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(){
function addAgentID(id,formName,ord) {
var IDlocation = parseInt(ord);
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", "agentHeaderID");
input.setAttribute("value", id);
document.getElementsByClassName(formName)[IDlocation].appendChild(input);
}
@amcn84
amcn84 / addAgentID
Last active August 11, 2017 00:58
IDX Broker / Equity : Add Agent Header ID to Forms
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(){
function addAgentID(id,formName) {
var input = document.createElement("input"); // Setup the hidden input field
input.setAttribute("type", "hidden");
input.setAttribute("name", "agentHeaderID");
input.setAttribute("value", id); // this is where the given agentHeaderID is used
document.getElementsByClassName(formName)[0].appendChild(input);
}
// List of forms that should be targeted