First time here? Check out the FAQ!
0

cannot apply a css on login/password fields

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',
Samuel's avatar
425
Samuel
updated 2011-06-07 09:22:22 -0500, asked 2011-06-07 05:50:57 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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?

Evgeny's avatar
13.2k
Evgeny
updated 2011-06-08 01:12:01 -0500, answered 2011-06-08 01:04:29 -0500
edit flag offensive 0 remove flag delete link

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's avatar Samuel (2011-06-08 02:58:34 -0500) edit
No problems :) big deal.
Evgeny's avatar Evgeny (2011-06-08 03:03:37 -0500) edit
add a comment see more comments