Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marceldegraaf/102428 to your computer and use it in GitHub Desktop.
Save marceldegraaf/102428 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Today's date in new declaration
// @namespace http://slashdev.nl/
// @description Fills in today's date in FUO's New Declaration screen
// @include https://extranet.finalist.com/FacturenOnline/selfbilling/declarationModifyAction.do?dispatch=initCreateDeclaration
// ==/UserScript==
(
function setDateFields()
{
var current_time = new Date();
var table_rows = document.getElementsByName('receiptTr');
for(i = 0; i < table_rows.length; i++)
{
setValueOnElement("receiptVO["+i+"].fromDay", current_time.getDate());
setValueOnElement("receiptVO["+i+"].fromMonth", current_time.getMonth() + 1);
setValueOnElement("receiptVO["+i+"].fromYear", current_time.getFullYear());
}
function setValueOnElement(element_name, value)
{
var elements = document.getElementsByName(element_name);
elements[0].value = value;
}
}
)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment