Here is script I have. I'm trying to load it after page display. I'm trying to execute PHP code from javascript. What I need is to get email address of user who submitted the form at the textbox control.
var originator_email = document.getElementById("jform_sendto_first_step");
originator_email.value = "<?php echo JFactory::getUser($this->item->created_by)->get('email'); ?>"
This is the error I have. using $this when not in object context bla bla bla. What's proper way of doing this ?
Have tried to include the code:
<?php echo JFactory::getUser($this->item->created_by)->get('email'); ?>
into the page directly and I can see it throw the result to the screen no problems.