West Midlands trains delay repay script

Published January 17, 2020

Anyone who has been through the Delay Repay system with a season ticket for West Midlands trains knows that the web site is not built with the user's convenience in mind. The site makes it very difficult to enter things like start and end dates that aren't close to the current date, and it does not remember details across multiple visits.

As such I have a simple block of JavaScript I paste into the console when going through the process to greatly speed it up. When you reach the page to enter your season ticket details, open the developer tools console in your browser and paste in the following (amended with your values, of course):

var validFrom = '15/1/2020';
var validTo = '14/1/2021';
var startStation = 'BIRMINGHAM MR ST';
var endStation = 'OLTON';
var ticketCost = '66.50';
var swiftCardNumber = '631591011781573301'


document.getElementById('ValidFrom').value = validFrom;
document.getElementById('ValidTo').value = validTo;

document.getElementById('startstation').value = startStation;
document.getElementById('endstation').value = endStation;

document.getElementById('costofticket').value = ticketCost;
document.getElementById('swiftcardNumber').value = swiftCardNumber;

Filed under: javascript, trains

Talk is cheap

Leave a comment:

HTML is not valid. Use:
[url=http://www.google.com]Google[/url] [b]bold[/b] [i]italics[/i] [u]underline[/u] [code]code[/code]