add text to a form Topic is solved

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
natsort

add text to a form

Post by natsort » Tue Feb 26, 2008 1:36 pm

Does anyone know how I can add pre-defined text to a login form.

eg.
I want to show users that they should use "name" for login and a special password.
So I was thinking of making a login form saying:

Login: [name]
Password: [available from the letter you've received]

Therefor I want to include "name" and "available from the letter..." in the login form when it appears.
But how?

David

radiant_tech
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Sat Dec 15, 2007 3:02 pm
Location: Washington DC Metro

Re: add text to a form

Post by radiant_tech » Fri Feb 29, 2008 10:34 pm

Assuming you are using J!1.5, create an override for the mod_login template file.

Open joomla_root/modules/mod_login/tmpl/default.php and save it as joomla_root/templates/yourtemplate/html/mod_login/default.php.

Then edit the input boxes for the username and password fields. Change

Code: Select all

<input id="modlgn_username" type="text" name="username" class="inputbox" alt="username" size="18" />
to

Code: Select all

<input id="modlgn_username" type="text" name="username" class="inputbox" alt="username" value="name" size="18" />
and change

Code: Select all

<input id="modlgn_passwd" type="password" name="passwd" class="inputbox" size="18" alt="password" />
to

Code: Select all

<input id="modlgn_passwd" type="password" name="passwd" class="inputbox" value="your_text_here" size="18" alt="password" />
Denise


Post Reply