MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b1536/advancedfunctions.co/AMBV3/
File Upload :
Current < : //hermes/sb_web/b1536/advancedfunctions.co/AMBV3/gui.js

//common gui interfaces and their respective functions

/**
Insert the following in script tags to run code whenever a checkbox is clicked
function onClickCheckbox(){}
**/

/**
Insert the following in script tags to create a choice
function createChoice(choiceName,choiceText)
**/

/**
Insert the following in script tags to create a button
createButton(buttonName,buttonText,functionToExecute)
**/

/**
Insert the following in script tags to add code or text to a 'div' element
function displayUi(elementId,codeOrText)
**/

function createChoice(choiceName,choiceText){
return "<input type='checkbox' id='"+choiceName+"' onclick='javascript:onClickCheckbox()'><label for='"+choiceName+"'>&nbsp;"+choiceText+"</label>";
}

function createButton(buttonName,buttonText,functionToExecute){
return "<button class='btn btn-default' id='"+buttonName+"' onclick='javascript:"+functionToExecute+"'>"+buttonText+"</button>";
}

function getValue(elementId){
return document.getElementById(elementId).checked;}

function setValue(elementId,trueOrFalse){
document.getElementById(elementId).checked=trueOrFalse;}


function setEnabled(elementId,trueOrFalse){
document.getElementById(elementId).disabled=!trueOrFalse;}

function displayUi(elementId,codeOrText){
document.getElementById(elementId).innerHTML=codeOrText;
}

function createSpan(spanID){
return "<span id='"+spanID+"'></span>";
}