...

View Full Version : array value to propercase



crmpicco
08-17-2005, 12:11 PM
// Function to change any text to Proper Case (e.g. picco -> Picco)
String.prototype.toProperCase = function()
{
return this.charAt(0).toUpperCase() + this.substring(1,this.length).toLowerCase();
}

function functioname()
......
..

div = document.getElementById('demodiv')
div.innerHTML='<table border=1>'
div.innerHTML=div.innerHTML+'<tr><td>FARE RULES<br></td></tr>'

for (u=1;u<=counter;u++)
{
div.innerHTML=div.innerHTML+'<tr>'
div.innerHTML=div.innerHTML+'<td>'
div.innerHTML=div.innerHTML+headingArr[u]+'&nbsp;&nbsp;&nbsp;&nbsp;'
div.innerHTML=div.innerHTML+'</td>'
div.innerHTML=div.innerHTML+'<td>'
div.innerHTML=div.innerHTML+contentArr[u]+'&nbsp;&nbsp;&nbsp;&nbsp;<br>'
div.innerHTML=div.innerHTML+'</td>'
div.innerHTML=div.innerHTML+'</tr>'
}
bTableSetup = true;
div.innerHTML=div.innerHTML+'</table>'
...
....


how can i change the value of headingArr[u] to be Proper case, ie. Picco instead of picco

crmpicco
08-17-2005, 01:12 PM
cell = row.insertCell()
cell.innerHTML = headingArr[a].toProperCase()
cell2 = row.insertCell()
cell2.innerHTML = contentArr[a].toProperCase()



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum