A Space!!! That took enough time..!!

I was doing my adjustments to the code for my BIT project. You' can’t imagine the bugs I create with this coding. It took me the whole evening to figure out an error in the code.

<div id="expiry0"><input type="text" onclick="javascript:showDateFrame(0, 'exp', 'MED1');" size="10" readonly="true" id="expiryTxt0" name="expiryTxt0"/></div>

This piece of code defines my expiry date input. its labelled expiryTxt0. But there was a space after the “0”!!! Javascript kept saying there was no such object as expiryTxt0. Took me about 3 hours and firebug to figure out there was a space in thr html code which made the id “expiryTxt0 “ instead of “expiryTxt0”.

That’s software life!!! Phew!!! I’m happy I got it without doing major changes to the code trying to avoid the error.

Posted in Labels: , , , , |

0 comments: