Click to See Complete Forum and Search --> : Link is not working properly


manishrathi
07-21-2009, 11:28 AM
\
\
\
<a class="bt_alreadyLogin" title="Log in" href="javascript:submitLoginBox(document.forms.loginForm)">
<img title="Log in" alt="Log in" src="/web/images/en/bt_loginSubmit.gif"/>
</a>
<div class="wrapAlreadyLinks">
<span class="smaller">
<input type="checkbox" id="rememberLB" name="rememberusername"/>

<label for="rememberLB"><%=rememberme%></label><br/>
<%=forgot%><br/>

<a href="https://www.rogers.ca/rogers/PrsMyAccts_PwdReset.page" target="_self" />
<%=notregister%><br/>

<a href="https://www.rogers.ca/rogers/PrsMyAccts_Registration.page" target="_self" />

In the above code, the last link for "notregister" is working fine. But the link above that for "forgot" is not working. I dont know whats wrong in it ? If I place "forgot" in the end then its working fine and "notregister" is not working.

This code is for a login page, where user puts his username and password and selects the option "remember me" or "not registered" , if he is not registered and "forgot" if user forgets his username or password. And depending on the link clicked, respective page opens up.

Can someone pls explain why are the links not working properly ?

thanks

Charles
07-21-2009, 11:45 AM
Switch from XHTML to HTML and all will be well.

manishrathi
07-21-2009, 12:11 PM
How do I know that I am using xhtml ?

how to switch from xhtml to html ? If I want to keep using wht I am using currently, what care shd I take to make page look properly ?

thanks

6StringGeek
07-21-2009, 12:21 PM
The trailing slashes (/) indicates xhtml. You should also have a DTD stating the same. You would need to replace that with another DTD and remove the slashes.

manishrathi
07-21-2009, 12:28 PM
You mean trailing slashes in <br> tag ? Because other trailing slashes are in html also. Like one in input, if there are no child elements to the tag, then it can be closed with trailing slash.

Only unusual trailing slashes I find in this doc is in <br> tag.

So I understand, if I remove tariling slash from <br> , then it will work fine. Please correct me , if I am wrong.

6StringGeek
07-21-2009, 12:45 PM
I am not a genius about this stuff, but my understanding is that you do need the trailing slashes in xhtml when using any self-closing tag, which would mean you also need the correct DTD, such as:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

If you change the DTD to html you can remove the trailing slashes.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

I would also recommend that you validate you HTML here: http://validator.w3.org/.

manishrathi
07-21-2009, 12:59 PM
Code mentioned in first post is part of jsp. So there is no section like below
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Now, I did remove trailing slash from the <br> tag. But still I am facing same issue. So whats wrong in here ?

thanks

Charles
07-21-2009, 01:00 PM
I was referring to the trailing slash in the A opening tag, which closes the tag which makes it empty and not work. You might have something else going on there but first change to HTML and then validate and then check to see if the problem has corrected itself.