function formTools(){
var ui = $('<div class=form-tools><ul class=parentmenu><li data-type=save><img src=https://agrisphere-portal.com/clientPortal/assets/formtools/save.png><li data-type=load><img src=https://agrisphere-portal.com/clientPortal/assets/formtools/open.png><li data-type=print><img src=https://agrisphere-portal.com/clientPortal/assets/formtools/print.png><li data-type="download PDF"><img src=https://agrisphere-portal.com/clientPortal/assets/formtools/download.png></ul><ul class=submenu data-type=save><li><h3>SESSION</h3><p>Data is saved to device storage and is removed the next time the form is submitted.<h4>AUTO-SAVE<span data-state=off></span></h4><li><h3>TEMPLATE</h3><p>Data is saved to user profile on server. Data may be reused and is available to all devices logged into the account.<li><h3>FILE</h3><p>Data is exported to a JSON file that can be shared with other users and devices and can be imported at any time</ul><ul class=submenu data-type=load><li><h3>SESSION</h3><p>Apply Auto-fill data saved to device storage.<li><h3>TEMPLATE</h3><p>Apply templated data to the form.<li><h3>FILE</h3><p>Apply an imported JSON file\'s data to the form.</ul></div>');
ui.find('>ul.parentmenu>li').click(function(e) {
ui.find('>ul.submenu').removeClass('show');
var type = $(this).attr('data-type');
ui.find('>ul.submenu[data-type="' + type + '"]').addClass('show');
e.stopPropagation();
});
ui.find('>ul.submenu').click(function(e) {
e.stopPropagation();
});
$('body').click(function() {
$('.form-tools>ul.submenu').removeClass('show');
});
$('body').append(ui);
}
$(document).ready(function(){
formTools();
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.