Post by comprido » Thu Sep 26, 2013 9:15 pm

Hi!

I´m looking for help to learn how to copy the attributes from one language textarea for the other ones.

Looking code at 769 product_form.tpl I have found the line:

Code: Select all

	html += '<textarea name="product_attribute[' + attribute_row + '][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"></textarea><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />';
Maybe I may do something like: http://www.codingforums.com/showthread.php?t=151316 with:

Code: Select all

	html += '<textarea id="text<?php echo $language['language_id']; ?>" name="product_attribute[' + attribute_row + '][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"></textarea><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />';
and

Code: Select all

<script type = "text/javascript">
function copyIt() {
var x = document.getElementById("txt2").value;
document.getElementById("txt1").value = x;
document.getElementById("txt3").value = x;
document.getElementById("txt4").value = x;
}
</script>
Any help?
Thanks in advance!

Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido


User avatar
New member

Posts

Joined
Mon Sep 10, 2012 11:46 pm

Post by comprido » Tue Oct 01, 2013 8:10 pm

SEARCH FOR

Code: Select all

function addAttribute() {
JUST BEFORE ADD:

Code: Select all

function copiar()  {
	    taValue = document.getElementById("att1").value;
		document.getElementById("att2").innerHTML = taValue;
		document.getElementById("att3").innerHTML = taValue;
		document.getElementById("att4").innerHTML = taValue;
		 }
SEARCH FOR:

Code: Select all

<?php foreach ($languages as $language) { ?>
		html += '<textarea name="product_attribute[' + attribute_row + '][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"></textarea><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />';
    <?php } ?>
CHANGE TO:

Code: Select all

<?php foreach ($languages as $language) { ?>
		html += '<textarea onkeyup="copiar()" id="att<?php echo $language['language_id']; ?>" name="product_attribute[' + attribute_row + '][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"></textarea><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />';
    <?php } ?>
UPLOAD AND ENJOY.

Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido


User avatar
New member

Posts

Joined
Mon Sep 10, 2012 11:46 pm
Who is online

Users browsing this forum: Google [Bot] and 52 guests