Page 1 of 1

add text to a form

Posted: Tue Feb 26, 2008 1:36 pm
by natsort
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

Re: add text to a form

Posted: Fri Feb 29, 2008 10:34 pm
by radiant_tech
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" />