set random number on textbox through java script.
function random()
{
var generator = Math.floor(Math.random()*10000);
var ss="BN"+"-"+generator;
document.getElementById("bill").value=ss;
var generator1 = Math.floor(Math.random()*10000);
var ss1="ON"+"-"+generator1;
document.getElementById("on").value=ss1;
return false;
}
<body class="aaa" onload="InitialLoad(); random();">
<tr>
<td>Bill Number</td>
<td><input type="text" name="bill" class="text4" id="bill"></td>
<td>Bill Date</td>
<td><input type="text" name="billdate" class="text4" id="billdate"></td>
<td>Order Number</td>
<td><input type="text" name="on" class="text4" id="on"></td>
</tr>