One click FSA code validation
Code below adds a link on "view broker" tab by clicking on which FSA number validation results are shown in a new popup window
function validateFSA() {
var inp = $$('#ctl00_MainContent_formFSANo')[0];
w = window.open('', 'wnd', 'width=800,height=600,menubar=0,toolbar=0,status=0,scrollbars=0,resizable=0');
w.document.open();
w.document.write(
'<html>\
<head>\
<title></title>\
</head>\
<body onload="document.search.submit();">\
<form name="search" action="http://www.fsa.gov.uk/register/firmRefSearch.do" method="post">\
<input type="hidden" name="firmRef" value="' + inp.getValue() + '">\
</form>\
</iframe>\
</body>\
</html>');
w.document.close();
}
Event.observe(window, 'load', function () {
if (document.URL.indexOf('ViewBroker.aspx') > 0) {
var fsaTd = $$('td.l').findAll(function(e) { return e.innerHTML.indexOf('FSA Number') != -1; })[0];
fsaTd.update('<a href="#" onclick="validateFSA();">FSA Number</a>');
}
});
Please sign in to leave a comment.
Comments
0 comments