Recap:
My javascript
$j(textoDelId, window.parent.document).html('Add<input type="hidden" id="imagenv" name="imagenv" value="'+imgstr+'"/>');
My new submit button:
<form action="javascript:void(0);" name="imagen" id="imagen" method="post"><button id="<?php echo $idBotonCarritoCustom ?>" type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="mandarAlCarro('<?php echo $this->getAddToCartUrl($_product) ?>',
<?php $idOptionCorte = -1; foreach ($_product->getProductOptionsCollection() as $option) {
if($option->getTitle() == 'Corte') {
$idOptionCorte = $option->getOptionId();
}}
echo $idOptionCorte?>, <?php echo $_product->_getData('entity_id'); ?>)">
<span><span><?php echo $this->__('Add to Cart') ?></span></span></button></form>
And finally the final destination:
<?php echo $_POST["imagenv"]; ?>
imgstr has the correct value as a alert after that JS line, shows that string that I want to pass.