Greetings.
Love the component and the submitcontent form. I had only one complaint with it, which is that I wanted registered users to be able to submit articles under their names without having to type it in -- in other words, I wanted to prepopulate the name field with the user's Joomla username. Wasn't hard, in the end, and I thought I'd share it for others.
In the form code, add a "value" attribute to the input tag, as follows:
Works perfectly in Joomla 1.5.8.
Love the component and the submitcontent form. I had only one complaint with it, which is that I wanted registered users to be able to submit articles under their names without having to type it in -- in other words, I wanted to prepopulate the name field with the user's Joomla username. Wasn't hard, in the end, and I thought I'd share it for others.
In the form code, add a "value" attribute to the input tag, as follows:
<input value="<?php
$user =& JFactory::getUser();
if ($user->guest) {
echo "";
} else {
echo $user->username;
}
?>" class="cf_inputbox required validate-alpha" maxlength="15" size="30" id="text_7" name="created_by_alias" type="text">
Works perfectly in Joomla 1.5.8.
Hi Jaap,
Add the readonly="readonly" attribute. Or just add the name into ordinary html.
Bob
Add the readonly="readonly" attribute. Or just add the name into ordinary html.
<div>your name is <?php echo $user->name; ?>, isn't it!</div>Bob
This topic is locked and no more replies can be posted.
