I am trying to set text when loading a php file… I am doing somthing like this:
<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?>
<?php
echo "<script>
var a = document.getElementsByName('enquiry');
a.value='Pedido de Informação de Preço, relativamente ao producto: http://www.musicland.pt/musicstore/product_info.php?products_id=2581';
</script>"; ?>
Now I know that this is silly but is just a text. I want to do an evaluation first and if there is and id then fill the text area
the source generated have it correct and there is no javascript errors but the textarea stills empty.
I don’t understand why!?
Can someone help me out on this
getElementsByTagNamereturns a live node list. If your element has an ID, usegetElementById. If you want to do this on multiple elements in the node list, use aforloop.