Convert checkbox values to a string

I needed this javascript, so might someone else:

var checkbox = -1;

var unid = “”;

while ( document.forms[0].Delete[++checkbox]!=null){

if ( document.forms[0].Delete[checkbox].status="true" ){

	unid = unid + document.forms[0].Delete[checkbox].value + ";"

}

}