, , , , , ,

Recently, I found a service that HDFC Bank provides to recharge prepaid mobile phones in India. The service, listed here, is available for use via NetBanking or an ATM. Super cool, eh? Yeah, if only it works fine without any glitches !

The interface is quite simple and intuitive to use. Users just need to enter their mobile number and the amount and confirm the transaction. The next page informs the users that their request is being processed and that the server may take about 1 to 5 seconds to process. There is also a point informing users not to submit again and not to use the Back or Refresh buttons in the browser. Well, that’s pretty good so far.

Now starts the excitement! The form never gets submitted. Wow! I can see a JavaScript error in Firebug console.

Being a developer is so much fun πŸ˜› Looking at the source, I found that this JS function gets called after a timeout of 5 seconds.

function go_now ()
form1.action="https://netbanking.hdfcbank.com/netbanking/merchant" ;
form1.method="post" ;
form1.submit() ;

And nowhere is form1 defined and Firebug faithfully reports this error.

form1 is not defined
form1.action=”https://netbanking.hdfcbank.com/netbanking/merchant” ;

So what do I do? Well, I write a few lines in the FB console to submit the form myself. The variable form1 happened to be document.getElementById(‘form1’) and got submitted without any further errors. After this submission, the redirection happens to the NetBanking page properly and from thereon, there are no problems and the mobile recharge happened successfully !!

Personally, the errors apart, I like this facility as it saves me a lot of time and hassle. And I can always write a GreaseMonkey script to automate this submission πŸ™‚ But how on earth are these errors still not detected and fixed by concerned people? Is it proof that not many are using such facilities in India?

UPDATE: I have never checked this feature in any browser other than Firefox. The error does not occur in IE, since it is not mandatory to get the reference to the element by calling getElementById() in IE. The elementName.property will work just fine. This is one more glorious example of IE not following proper standards! Thanks Manu..