• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Fill field automatically based on logged in user?

Fill field automatically based on logged in user? 6 years 4 months ago #37637

I would like to do the following.

I'd like to fill a textbox with a certain value based on which user is logged in.

Something like this:

<?php
$user = JFactory::getUser();
if($user->id==42) { ?>
<script type="text/javascript">
$(document).ready(function(){
$("#Email1").val(" This e-mail address is being protected from spambots. You need JavaScript enabled to view it ");
});
</script>
<?php } ?>


In the Form Properties there are 3 different PHP "areas". They are:

1. Script called on form display (HTML code of the form ; I think this is where I should add this code)
2. Script called on form process (POST Data)
3. Script called after form has been processed (Thank you Message)

It is mentioned to not include the "php" opening and closing tags, so I don't understand how I'm supposed to use the php tags when I want other scripts such as Javascript involved?

Basically, it must just set the value for 5 fields, textboxes #Email1 to #Email5, depending on the user which is logged in. When the form is submitted, the users will still receive the values.

Any help would be appreciated. Thanks
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!