Jump to content

w3c double login form issues

- - - - -

  • Please log in to reply
4 replies to this topic

#1
circuz_phreak

circuz_phreak

    Newbie

  • Members
  • Pip
  • 5 posts
I have a login form that is dynamically displayed with javascript and has nice drop down effects when the link is clicked. When javascript is disabled it degrades to a link that will load the login form in the pages main content. This method is preferrable so I can support both javascript and non-javascript users.

The problem is that in the case where javascript is disabled, the login form is actually created twice on the page when the user follows the login link. Once for the javascript drop down (which isn't possible to trigger anymore) so this form is hidden. And the second form which gets created after following the link.

This violates w3c validation because I don't have unique id's for login and a couple other attributes. So having two identical forms causes duplicate id's. I don't have to worry about this when javascript is enabled because the second form won't get created. functionality is still 100% ok and the only issue is w3c standards. I would like to meet them because I do believe it is important and professional.

PHP only detects if a browser supports JS not if it is enabled or disabled. I can't think of a solution that would allow me a single unique login form for both scripted and non-scripted situations. The javascript version is nice and professional, and the non-js version is a necessity to support all users....so i guess i'm stuck not validating in this rare case unless someone has a solution.

Any suggestions? Thanks.

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
you should have the same <div> for both uses.

I mean, if there is no javascript, show it on main content, if it is, hide it until your javascript shall show it again.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
circuz_phreak

circuz_phreak

    Newbie

  • Members
  • Pip
  • 5 posts
That's how it is already set up. The only time it does not validate is when javascript is disabled and the second form is in the main content. At that point there are two login forms, when javascript is enabled the main content login form is never created so there is only one.

I need to solve the problem for the following scenario:

Javascript disabled + javascript login form + main content login form + validation error

#4
Root23

Root23

    Programmer

  • Members
  • PipPipPipPip
  • 144 posts
Sorry if I'm wrong, but what I Think Orjan was saying is to only have one div and one form. Use Javascript to have that div hidden when the page loads, and then when they need to login the javacript will make it appear and do the effects you're wanting. If the person does not have javascript, then the form will just be displaying already. Is there no way to have the main login be there by default in the area you want it, and then if javascript is on have it hidden & appear in the right place with your effects?
Posted Image

#5
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
You understand me totally correct, Root23
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users