Blog

Remove Form Functionality

Here are a collection of client scripts you can use to remove form elements if they are not wanted or needed in certain situations

1. Client Script: Remove Paperclip
When: onLoad

function onLoad() {
try {
var refs = document.getElementsByTagName("a");
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs[i];
var inner = ref.innerHTML;
if (inner.indexOf("attachment.gifx") > 0) {
ref.style.display = 'none';
}
}
}
} catch (e) {}
}


2. Client Script: Remove Navigation
When: onLoad

function onLoad() {
try {
var refs = document.getElementsByTagName("a");
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs[i];
var inner = ref.innerHTML;
if (inner.indexOf("nav_down.gifx") > 0) {
ref.style.display = 'none';
}
if (inner.indexOf("nav_up.gifx") > 0) {
ref.style.display = 'none';
}
}
}
} catch (e) {}
}


3. Client Script: Remove Tab Toggle
When: onLoad

function onLoad() {
try {
var refs = document.getElementsByTagName("a");
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs[i];
var inner = ref.innerHTML;
if (inner.indexOf("tab_toggle.gifx") > 0) {
ref.style.display = 'none';
}
}
}
} catch (e) {}
}


4. Client Script: Remove Section Collapse
When: onLoad
Script:

function onLoad() {
try {
var refs = document.getElementsByTagName("a");
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs[i];
var inner = ref.innerHTML;
if (inner.indexOf("collapseall.gifx") > 0) {
ref.style.display = 'none';
}
if (inner.indexOf("section_reveal.gifx") > 0) {
ref.style.display = 'none';
} 
}
}
} catch (e) {}
}

5. Client Script: Remove Email Button
When: onLoad
Script:

function onLoad() {
try {
var refs = document.getElementsByTagName("a");
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs[i];
var inner = ref.innerHTML;
if (inner.indexOf("email.gifx") > 0) {
ref.style.display = 'none';
}
}
}
} catch (e) {}
}


6. Client Script: Remove Live Feed Button
When: onLoad
Script:

function onLoad() {
try {
var refs = document.getElementsByTagName("a");
if (refs) {
for (var i=0; i < refs.length; i++) {
var ref = refs[i];
var inner = ref.innerHTML;
if (inner.indexOf("live_company_feed.gifx") > 0) {
ref.style.display = 'none';
}
}
}
} catch (e) {}
}