Ask Your Question
0

cannot apply a css on login/password fields

asked 2011-06-07 05:50:57 -0600

Samuel gravatar image

updated 2011-06-07 09:22:22 -0600

In order to be able to apply a css on the fields "login" and "password", the class names must not contain spaces.

Please, could you rename the class "required login" by "required_login" by applying the following patch :

diff --git a/askbot/deps/django_authopenid/forms.py b/askbot/deps/django_authopenid/forms.py
index 429fa55..1e5aa6d 100644
--- a/askbot/deps/django_authopenid/forms.py
+++ b/askbot/deps/django_authopenid/forms.py
@@ -131,7 +131,7 @@ class LoginForm(forms.Form):
     password = forms.CharField(
                     max_length=128,
                     widget=forms.widgets.PasswordInput(
-                                            attrs={'class':'required login'}
+                                            attrs={'class':'required_login'}
                                         ),
                     required=True
                 )
@@ -143,14 +143,14 @@ class LoginForm(forms.Form):
     new_password = forms.CharField(
                     max_length=128,
                     widget=forms.widgets.PasswordInput(
-                                            attrs={'class':'required login'}
+                                            attrs={'class':'required_login'}
                                         ),
                     required=False
                 )
     new_password_retyped = forms.CharField(
                     max_length=128,
                     widget=forms.widgets.PasswordInput(
-                                            attrs={'class':'required login'}
+                                            attrs={'class':'required_login'}
                                         ),
                     required=False
                 )
diff --git a/askbot/utils/forms.py b/askbot/utils/forms.py
index 575416b..f159ce8 100644
--- a/askbot/utils/forms.py
+++ b/askbot/utils/forms.py
@@ -38,7 +38,7 @@ class NextUrlField(forms.CharField):
     def clean(self,value):
         return clean_next(value)

-login_form_widget_attrs = { 'class': 'required login' }
+login_form_widget_attrs = { 'class': 'required_login' }

 class UserNameField(StrippedNonEmptyCharField):
     RESERVED_NAMES = (u'fuck', u'shit', u'ass', u'sex', u'add',
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2011-06-08 01:04:29 -0600

Evgeny gravatar image

updated 2011-06-08 01:12:01 -0600

Actually, it is possible:

.required.login {} /* selects elements with both classes, won't work in IE6 */

If no space is used between classes in the css file.

When space is used in HTML in the assignment like class="login required" it means that multiple classes are used on the element at the same time.

or

.login {} /* just login class */

or even

body.openid-signin .login.required {} /* both classes on openid-signin page */

Or I don't understand your intention?

edit flag offensive delete link more

Comments

Your understanding is correct. I did not know the possibility to have multiple classes. I should have searched deeper before posting this question. I confirm that if I choose a class between "login" and "required" in the css it works fine. So forget my question and the patch. Thanks.
Samuel gravatar imageSamuel ( 2011-06-08 02:58:34 -0600 )edit
No problems :) big deal.
Evgeny gravatar imageEvgeny ( 2011-06-08 03:03:37 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-06-07 05:50:57 -0600

Seen: 462 times

Last updated: Jun 08 '11