Created
April 27, 2009 10:28
-
-
Save marceldegraaf/102428 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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