Bookmarks with <a> tag in php not working

hi all

i have this below url in the form action=“”


manage.php?dealer=9&category=1&subcatg=6#av606

then in the page i have


<a name='av606' /></a>

on submitting the form the page should move to this place where a tag is placed

but it doesnt.

vineet

Uhm, no it shouldn’t… you have a valid URL, it’s going to go to that URL and not on the current page. good lord, WHY would you want it to do that?!?

When the submit fires it will reload the URL, even if it’s the current one. What you are asking for doesn’t even make sense (and really has nothing to do with PHP either, this is a HTML question).

<a name='av606' /></a>

This looks invalid to me. Shouldn’t it be

<a name='av606' />

or

<a name='av606'></a>

depending on what version of (X)HTML you’re using?

Yer right on that, good catch – it should be the LAST of those you listed, but this:

That is NOT valid – EVER, even in XHTML – because A is not a “empty element” – only empty elements can use the /> closing.

… and just because the anchor has no content doesn’t mean it’s an ‘empty element’ – empty elements by the meaning in the specification are those that CANNOT have content, as opposed to those that simply don’t have content… meaning the valid “empty elements” which are eligble for the “short form” closing are:

BR, HR, META, LINK, BASE, IMG, EMBED, PARAM, AREA, COL, BASEFONT, ISINDEX and INPUT.

NO other tags can use the <tag /> form and be valid code… which is why you still have to do <script></script> as <script /> is ALWAYS invalid.

Though I stopped using anchors and the name attribute for hash links LONG ago – that’s ID’s job now!

You’re right. Should have thought a bit more before answering :slight_smile:

[ot]Ah… but you can think? :stuck_out_tongue:

yes, people, yes… I like to live a dangerous life… one of these days I’ll be killed for my bad jokes and because I’m filling the forum with fluff… muahahahaa[/ot]