edit the registration form code?

Started by bob799, August 25, 2016, 02:44:52 PM

Previous topic - Next topic

bob799

Im looking to simplify the registration form.

where it says password: on the registration form I want to add more to it and bracket it with information to stop confusion. For example so the form would say...

Password: (Must be more than 8 Characters)

instead of just

Password:

The closest I found to editing it was the following code from register.template.php and is the following:

<dl class="register_form" id="password1_group">
<dt><strong><label for="smf_autov_pwmain">', $txt['choose_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwmain_div" style="display: none;">
<img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.gif" alt="*" />
</span>
</dd>


Im not very experienced at PHP but how do I edit it tot he way I want it?

Any help would be appreciated greatly.

Thanks

Grammy

If it's 2.0.11, you can just go to Admin----> Configuration---->Languages, then click your forum's language and use the pulldown on the right and select General Strings.  There should be "Choose Password" there.  You can edit it.  Scroll down to the very bottom on the left and click Save when you're done.   :)


Illori

Quote from: Grammy on August 25, 2016, 03:08:05 PM
If it's 2.0.11, you can just go to Admin----> Configuration---->Languages, then click your forum's language and use the pulldown on the right and select General Strings.  There should be "Choose Password" there.  You can edit it.  Scroll down to the very bottom on the left and click Save when you're done.   :)



we really dont recommend using the editor as you dont create a backup of the file in case there is an issue. it is better to create a backup and manually edit the files as needed.

Grammy

Quote from: Illori on August 25, 2016, 03:13:36 PM

we really dont recommend using the editor as you dont create a backup of the file in case there is an issue. it is better to create a backup and manually edit the files as needed.

Ah.  I've always done it that way and just assumed that, since SMF made that option available in Admin, it was okay to use it. 

Oops, then.   :D

Illori

Quote from: Grammy on August 25, 2016, 03:15:44 PM
Quote from: Illori on August 25, 2016, 03:13:36 PM

we really dont recommend using the editor as you dont create a backup of the file in case there is an issue. it is better to create a backup and manually edit the files as needed.

Ah.  I've always done it that way and just assumed that, since SMF made that option available in Admin, it was okay to use it. 

Oops, then.   :D

also if the files are not writable, then it would fail to do the edits and not tell the admin it failed.

Sir Osis of Liver

Did this for another poster, you should be able to tinker with it to suit your purpose.


Register.template.php -



echo '
<dl class="register_form" id="password1_group">
<dt><strong><label for="smf_autov_pwmain">', $txt['choose_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwmain_div" style="display: none;">
<img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.gif" alt="*" />
</span>
</dd>
</dl>

<dl style="width: 70%; padding: 5px 0 0 10px; line-height: 130%; font-size: 10px; color: red;">The password must be at least eight characters long, and cannot be part of your username or email address.  It must contain a mixture of upper and lower case letters, and at least one number.  The red X will change to a green checkmark, when you have typed in a good password.</dl>

<dl class="register_form" id="password2_group">
<dt><strong><label for="smf_autov_pwverify">', $txt['verify_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwverify_div" style="display: none;">
<img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.gif" alt="*" />
</span>
</dd>
</dl>';

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: