<p id="line1"> </p>
<p> </p>
<p id="line2"> </p>
<input type="text" onkeyup="document.getElementById('line1').innerHTML=this.value">
But not sure how to add that to the engraving array. any ideas would be helpful

Code: Select all
function countallchars(prodref){
var chars = 0;
var maxlines = document.getElementById('inf0' + '_' + prodref).value;
for ( var i = 1; i <= maxlines; i++ ) // for all length entries
{
if ( document.getElementById('inf' + i + '_' + prodref) )
{
var thisline = document.getElementById('inf' + i + '_' + prodref).value
thisline = thisline.replace(/\s/g,''); // remove spaces
chars += thisline.length;
}
}
return chars;
}
Code: Select all
function countallchars(prodref){
var text = ''; // text to overlay image
var chars = 0;
var maxlines = document.getElementById('inf0' + '_' + prodref).value;
for ( var i = 1; i <= maxlines; i++ ) // for all length entries
{
if ( document.getElementById('inf' + i + '_' + prodref) )
{
var thisline = document.getElementById('inf' + i + '_' + prodref).value
text += thisline + '<br/>'; // add to overlay text
thisline = thisline.replace(/\s/g,''); // remove spaces
chars += thisline.length;
}
}
if ( document.getElementById('text_' + prodref) ) // have we an overlay area
{
document.getElementById('text_' + prodref).innerHTML = text;// display text in overlay
}
return chars;
}