A more convenient way
Depending upon what you are using this for you can make use of HTML arrays. This allows you to declare an inputs name as selectboxvalue[]
and when the form is submitted you will get the inputs back as an array of values.
Depending up on the language you are using to process the form this may or may not be handled natively. PHP does - please see the docs.
Direct answer
var selectIndex = 1;
function createInput() {
if(jQuery('input[name="selectboxvalue"]').length > 0){
var selectbox = jQuery('<input>', { name: 'selectboxvalue' + selectIndex, type: 'checkbox' });
jQuery('blah').append(selectbox);
selectIndex++;
}
}