Dear folks, Need help with this one. I am sorry for my naive question.
I have a 15 char text field (partnum). Which needs to be populated with a character string constructed based on user choice. each choice gives one or more characters that form the string. The final string looks something like 'A23-R67F22-M44T'. I am using Javascript. I guess I am thoroughly confused with the way JS handles char array and string and their interconversion. The function looks something like this.
function makePN(pos, cnt, obj){
var tmpprt=new Array(15); //make this global so it retains the value
for(i=0;i<cnt;i++)
tmpprt[pos+i]=obj.value;//??
document.pngen.partnum.value=tmpprt;
}
where pos is the position the char needs to be inserted. cnt is the no. of chars from there. obj is the object (such as radio, list box, checkbox etc.) that sent the value.
My thanks for your much appreciated help, in advance.
I have a 15 char text field (partnum). Which needs to be populated with a character string constructed based on user choice. each choice gives one or more characters that form the string. The final string looks something like 'A23-R67F22-M44T'. I am using Javascript. I guess I am thoroughly confused with the way JS handles char array and string and their interconversion. The function looks something like this.
function makePN(pos, cnt, obj){
var tmpprt=new Array(15); //make this global so it retains the value
for(i=0;i<cnt;i++)
tmpprt[pos+i]=obj.value;//??
document.pngen.partnum.value=tmpprt;
}
where pos is the position the char needs to be inserted. cnt is the no. of chars from there. obj is the object (such as radio, list box, checkbox etc.) that sent the value.
My thanks for your much appreciated help, in advance.