User data in Joomla 1.5

luykmhm 18 Dec, 2007
I spent a long time figuring out how to display registered user data in my form. There is a lot of information in this forum but most of it is regarding Joomla 1.0. I am using Joomla 1.5. Pay attention to the VALUE attribute.

Good luck with this wonderful tool.

Hopefully you can use this information.
<form id="form1" name="form1" method="post" action="">
  <p>Aanmelden voor thema -avond Persoons Gebonden Budget </p>
  <table width="200">
    <tr>
      <td>Naam</td>
      <td><input name="Naam" type="text" id="Naam" size="40" maxlength="40" value="<?php $user = &JFactory::getUser();echo $user->name;?>" /></td>
    </tr>
    <tr>
      <td>Email</td>
      <td><input name="email" type="text" id="email" size="30" maxlength="30" value="<?php $user = &JFactory::getUser();echo $user->email;?>" /></td>
    </tr>
    <tr>
      <td nowrap="nowrap">Aantal personen </td>
      <td><input name="aant_pers" type="text" id="aant_pers" size="2" maxlength="2" /></td>
    </tr>
  </table>
  <p>
    <input type="submit" name="Submit" value="Verstuur aanmelding" />
  </p>
</form>
<br><br>Post edited by: luykmhm, at: 2007/12/18 00:17
GreyHead 22 Dec, 2007
Hi luykmhm,

Great, thank you.

Bob
Raymon 12 Feb, 2008
Great Lukyhmh!!!

This is what i've been looking for quite some time now... How did you get to this solution? I'd really like to learn more about this kind of stuff... And looking in the api reference is like looking at a bool full of spagheti for a novice like me!

Thnx Again!

Grtz,
Raymon
Max_admin 12 Feb, 2008
Hi Raymon,

The API is for joomla itself, check their API site! but the code above is to be inserted in ChronoForms!

Cheers,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Raymon 12 Feb, 2008
Hi Max,

Sorry, I wasn't clear, I meant the Joomla Api.

Grtz,
Raymon
Max_admin 12 Feb, 2008
No worries, google Joomla API and you will get it!

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
zoopzoop 10 Apr, 2008
luykmhm, you can improve your code a bit by just calling the
$user = &JFactory::getUser();
once.
Like this:
<? $user = &JFactory::getUser(); ?>
<form id='form1' name='form1' method='post' action='' >
...
<td><input name='Naam' type='text' id='Naam' size='40' 
    maxlength='40' value='<?= $user->name; ?>' /></td>
...
<td><input name='email' type='text' id='email' size='30' 
    maxlength='30' value='<?= $user->email; ?>' /></td>
wcsconcierge 24 May, 2008
Sounds like what I need -- but I searched for JFactory in the Joomla extensions directory. Do you know how I can get this?
wcsconcierge 24 May, 2008
-- Never mind, JFactory is part of the Joomla Framework.
nortek 26 May, 2009
hi,

i've a problem to get e-mail of registered joomla user, while all works fine for username and name.
Html code is:

<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">E-mail</label>
<input class="cf_inputbox" name="elemail" type="text" id="elemail"
maxlength="30" size="30" title="" value="<?php $user = &JFactory::getUser();echo $user->email;?>" />

</div>

in e-mail field i get a very long string:

<script language='JavaScript' type='text/javascript'> <!-- var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy84775 = 'firstpartemail' + '@'; addy84775 = addy84775 + 'secondpartemail' + '.' + 'com'; document.write( '<a ' + path + '\'' + prefix + ':' + addy84775 + '\'>' ); document.write( addy84775 ); document.write( '<\/a>' ); //-->\n </script> <script language='JavaScript' type='text/javascript'> <!-- document.write( '<span style=\'display: none;\'>' ); //--> </script>Questo indirizzo e-mail รจ protetto dallo spam bot. Abilita Javascript per vederlo. <script language='JavaScript' type='text/javascript'> <!-- document.write( '</' ); document.write( 'span>' ); //--> </script>


that says e-mail address is protected by spam bot and it needs enable javascript to see it.How can I
get the only e-mail address?

thanks in advance
GreyHead 26 May, 2009
Hi nortek,

You have the Joomla Email Cloaking Plugin Enabled. Disable it and this code will go away.

Bob
nortek 26 May, 2009
Thanks a lot Bob!! was precisely that.
I've another little problem.
I can't set Enabled emails value of my forms to 1.I' m working in local, so maybe it could depend
from some local server configuration wrong.I set "Email the results" to yes and did all as
written in the tutorial.What do you think about?

thanks again.

Cris
GreyHead 29 May, 2009
Hi nortek,

If you are working locally then it's unlikely that you have an email server set up.

You can use SMTP with your ISPs smtp mailer url - or use Google mail if you setup a gmail account. (Settings are on the site Global Configuration | Server tab)

Bob
words2thewise 14 Jul, 2010
Looking for something exactly like this for my Joomla 1.5 site. Thank You!
hel-G 08 Nov, 2010
I had exactly the same problem and you hit it right in the eye, Bob! Thank you soo very much!๐Ÿ˜€

Tiffany
Westfield 13 Jan, 2011
It's my lucky day today ... Thanks everybody.
torinfo 17 Jul, 2011
For thos who want to use an email in chronoforms, but do not want to turn off the Anti Spam plugin (cloaking of emails, which results in javascript to display the email address), you can turn it off for a specific form, by creating a hidden field and give it the value

{emailcloaking=off}
GreyHead 17 Jul, 2011
Hi torinfo,

Or you can change the order of the plug-ins so that the Email Cloaking plug-in runs before the ChronoForms plug-in.

Bob
Kate454 03 Aug, 2011
For a new website I started with Joomla 1.6. Since there are not much formeditors yet for Joomla 1.6 AND since Chronoforms has good reviews I decided to give it a try.Very strong capabilities - however it took me some time to figure out my configuration given tabs and other places I did not initially look.
According to my experience with Joomla 1.5.Wish there was a way to use input masks, such as dd/mm/yyyy for dates and similar others for numbers or is it there?
GreyHead 03 Aug, 2011
Hi Kate454,

There are some built in validations using the MooTools FormCheck library. You can also add Custom validations if you don't see what you need.

Bob
This topic is locked and no more replies can be posted.