Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login input fields with static text, like ones on facebook? 2

Status
Not open for further replies.

MrMiyagi

Technical User
Feb 11, 2009
43
FI
Hello,

My problem is that i would like to have login input fields with text inside, like facebook has:

(email & password fields)

The email text input field has the text "email" in it statically until start to type something else, and password input field has text "password".

Facebook front/login page has also a functionality to select the email field straight away on refresh, so that the user does not have to select it, but can just start typing login info. How can i do this function?

for example password field html:
<input type="password" class="inputpassword" id="reg_passwd__" name="reg_passwd__" value="" />
From this i can see that the word typed inside the value field will come visible to the password field, but facebook html code has an empty value="" so the words email & password must come from somewhere else...javascript?

<input type="password"/>
This will make the inputted text into censoring balls

<input type="text" value="password"/>
This will bring the word password on the input field on every refresh.

Facebook input field has html input tag type=password value="" and the censoring balls appear when start to type. How is this done?

Thank you very much for all the answers!
 
Long post, last post as I'm flogging a dead horse :)
I'm only posting this as I think it's important for future readers to understand why my code sample was revised the way it was and that there is a point to the password->text->password thing.

vicvirk

Taking your bakery analogy.

Your example is talking about offering a different product to some users. That's not the point at all. It would be more accurate to say that your bakery can't serve very short customers because you have put in a new extra high counter - they simply can't get use it. What's more you, as the baker, refuse to lean over the counter for them and you aren't concerned with this as you can cater for *most* people.

Like you say the grocery store has the popcorn machine. Selling popcorn isn't your business so you don't need to have one regardless of how many customers want that tasty popcorn. However, you do sell bread so customers should be able to buy bread from your store regardless of their vertical attributes.

There is a difference between offering additional or different services and denying some customers access to your core service that you offer to everyone else. If you had a popcorn machine it would be available to everyone and not only for the 5%.

There is also a difference between people not wanting something and you denying access to something for some people but not others.


This one made me choke...

If you want to have javascript on your site, you simply don't allow people in who don't have javascript enabled.

Just... bleaurgh! Am I back in 1997? There is even possibly legal precident here. There certainly is with regards to not marking up images properly and requiring a mouse to perform a transaction (Maguire vs. SOCOG and NFB vs Target) and it's not a great stretch to see how this could extend to denying access to non-Javascript enabled clients.

Regarding Facebook. You can still use the site without Javascript. Registration is removed for some reason (which isn't good) but you can log in and use the site all the same. Besides, just because Facebook do it doesn't make it right.

Google Maps on the other hand provides an excellent example of progressive enhancement and perfectly illustrates the points I'm making. It is fully functional without using Javascript. But with Javascript turned on you get an enhanced user interface. The Javascript adds to the experience rather than providing the basic function of it.

I'm not sure why you brought up The way it's coded is irrelevant to this discussion.

It is perfectly possible to code something using HTML 3 and still have it be accessible. The Google page you linked to is an example of this. Despite using tables and font tags etc. there is nothing there that is inaccessible through reliance on 'bolt' on technologies such as Javascript. The fundamental interaction will always work.

The arguments for employing progressive enhancement in the ways described have nothing at all to do with the W3C or Web Standards but are everything to do with building practical and viable web applications.

Ironically, the example you give about replacing all the font tags very much illustrates my point about the importance and benefits of producing progressivley enhanced 'products', be that a web page or a web browser. You see, modern browsers are progressively enhanced (actually they gracefully degrade but the idea is the same even if the semantics aren't). They will work in a strict standards mode if your code is written as such but will degrade to a non standard mode quite happily if you don't. The browser designer thought about the users. Useful huh?

You may not have noticed either that Microsoft certainly do produce a standards compliant browser. If you write compliant code it will generally render properly in IE7. Sure there are some foibles areas and it isn't perfect but, with well crafted code, browser specific hacks or workarounds are minimal - like 1 or 2 lines of extra CSS. The HTML itself certainly doesn't require modification and hey, it's Microsoft. They've come a long way and IE8 is better still.

I think part of my failure to convince you here is that you really don't understand the point I'm trying to make nor why I am trying to make it. It's not about providing something different or even catering for all. Neither is it anything to do with Web Standards or about not using deprecated tags. It's about thinking about the user and doing what we can do to accomodate as many as possible and not excluding some because we can't be bothered.

I think I'll leave this here as there is no point going round in circles. You just aren't understanding the point as it's just not on your radar or anything you are interested in accepting, which is fair enough I guess. Each to their own.


Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top