Front-end Development---login Registration page optimization

Source: Internet
Author: User
Tags button type

1. The color of the error prompt text

http://v3.bootcss.com/css/#forms

jquery Tutorial:

Http://www.w3school.com.cn/jquery/index.asp

2. Project Address: Https://github.com/digitalClass/web_page

Site Address: http://115.28.30.25:8029/

3. Main work

Optimize Login Registration page display

Because of business needs, landing registration page was changed by the backend, showing the following results:

You can see that the form is all messed up. Open the backend given HTML file, completely messy

        <form action= "." Method= "POST" accept-charset= "Utf-8" >                           {% if form.errors  %}              {% include "users/ partials/errors.html "%}              {% endif%}              {% Csrf_token%}              {% for field in form%}              <div class=" Form-group "t Extalign= "Left" >                  {% include "users/partials/field.html"%}              </div>              {% endfor%}              < Button type= "Submit" class= "btn btn-primary" >Submit</button>            </form>        

And the field.html file is like this again.

{% load form_tags%}{% if Field.is_hidden%} {{field}}{% elif field|is_honeypot%} {% include ' users/partials /honeypot.html "%}{% Else%}<Divclass= "Field-wrapper {{Field|input_class}} {{field.css_classes}}{% if field|is_checkbox%} checkbox{% endif%}">{% if field.errors%}<labelclass= "Errorlist Control-label">{{field.errors|unordered_list}}</label><BR>{% endif%} {% if Field|is_checkbox%} {{field}} {% endif%}<label for= "{{Field.id_for_label}}"{% If field.field.required%} class= "Required"{% endif%}>{{Field.label}}{% if field.field.required%}<spanclass= "asterisk">*</span>{% endif%}</label>{% if not field|is_checkbox%} {{field}} {% endif%} {% if Field.help_text%} <Divclass= "Help_text">{{Field.help_text|safe}}</Div>{% endif%}</Div>{% endif%}

Completely do not understand good, but still want to change, no way to bite the bullet to change

However, this paragraph <li> can not find the corresponding good or bad ..... Change an egg!!!

Then there was no way to bite the bullet on JavaScript.

/**/$ (function(    ) {var text1 = $ (". Errorlist li"  ). First (). Text ()    $ (". Errorlist"). HTML (Text1);    $ (". Errorlist"). CSS ("Color", "#3c763d")})

Dynamically modify the code, I have been their own wit to frighten ...

4. Final effect:

Front-end Development---login Registration page optimization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.