Engraving add on?

Miscellaneous Actinic / SellerDeck patches and anything not covered above.
Post Reply
rich
Posts: 1
Joined: Mon Oct 27, 2008 5:36 pm

Engraving add on?

Post by rich »

Hello all. We have purchased the engraving script that works very well. but we found a website that does a very similar script but adds something else - a way for the text to be typed, but also placed above a jpg. This gives the engraving a visual look - https://www.roadid.com/Builder/Builder. ... tyle=WRIST Ive found some code for that to happen -
<p id="line1">&nbsp;</p>
<p>&nbsp;</p>
<p id="line2">&nbsp;</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 :)
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: Engraving add on?

Post by norman »

This would require some skill to implement. Here is an untested suggestion as to how this might be done.

Overlay a DIV onto your product image and give it an ID like

<div class="myoverlaytext" id="text_<actinic:variable name="ProductID" />">&nbsp;</div>

(I'm not a CSS expert so can't help further on how to do this.)

Edit textfieldsupport.js and look for the block of code

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;
}
replace it with

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;
}
Norman
Post Reply