FIlling Web Form From Desktop Javascript Does Not Insert Class Property

Using my local XOJO membership database I want to auto fill an online form to ‘register’ the local record on their system. Most fields work fine. The HTML around the online form field causing me an issue is;

<input style="visibility:hidden;display:block;float:right;margin:0 0 -1px -1px;width:1px;height:1px;overflow:hidden;border:0;padding:0;" id="ctl00_ContentPlaceHolder1_DOB" name="ctl00$ContentPlaceHolder1$DOB" type="text" class="rdfd_ radPreventDecorate" value="" title="Visually hidden input created for functionality purposes." /><div id="ctl00_ContentPlaceHolder1_DOB_dateInput_wrapper" class="RadInput RadInput_Bootstrap">
	Line 419: 								<input id="ctl00_ContentPlaceHolder1_DOB_dateInput" name="ctl00$ContentPlaceHolder1$DOB$dateInput" class="riTextBox riEnabled" type="text" /><div class="rcSelect">

In XOJO, of the below two lines, the top line works, the bottom does not, it just gives a blank entry. The hardcoded date works fine.

js = js + "document.forms[0].elements['ctl00$ContentPlaceHolder1$DOB$dateInput'].value='28/04/1966';"
js = js + "document.forms[0].elements['ctl00$ContentPlaceHolder1$DOB$dateInput'].value='"+nm.DOB +"';"

js is a string, and nm is a class of which DOB is a string property. Just wondering whether I am doing something wrong and why top hardcoded version does work and places the date but bottom one does not. I have checked nm and there is a valid date in the property before executing the javascript.